CreateChildControls Method (IEnumerable, Boolean)
Collapse the table of content
Expand the table of content

FormView.CreateChildControls Method (IEnumerable, Boolean)

Creates the control hierarchy used to render the FormView control with the specified data source.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

protected override int CreateChildControls (
	IEnumerable dataSource,
	bool dataBinding
protected int CreateChildControls (
	IEnumerable dataSource, 
	boolean dataBinding
protected override function CreateChildControls (
	dataSource : IEnumerable, 
	dataBinding : boolean
) : int
Not applicable.



An IEnumerable that represents the data source used to create the control hierarchy.


true to indicate that the control hierarchy is created directly from the data source; false to indicate the control hierarchy is created from the view state.

Return Value

The number of items created from the data source.

Exception typeCondition


The DataSourceView of the IDataSource to which the FormView control is bound is a null reference (Nothing in Visual Basic).

The CreateChildControls(IEnumerable,Boolean) method is a helper method called by the FormView control to create the control hierarchy for the FormView control. When the dataBinding parameter is true, data binding is performed before the control hierarchy is created.

Notes to Inheritors: When extending the FormView class, you can override this method to create your own control hierarchy.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

© 2016 Microsoft