DetailsView.CreateChildControls(IEnumerable, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates the control hierarchy used to render the DetailsView control.
protected:
override int CreateChildControls(System::Collections::IEnumerable ^ dataSource, bool dataBinding);
protected override int CreateChildControls (System.Collections.IEnumerable dataSource, bool dataBinding);
override this.CreateChildControls : System.Collections.IEnumerable * bool -> int
Protected Overrides Function CreateChildControls (dataSource As IEnumerable, dataBinding As Boolean) As Integer
Parameters
- dataSource
- IEnumerable
An IEnumerable that represents the data source for the DetailsView control.
- dataBinding
- Boolean
true
to indicate that this method is being called during data binding; otherwise, false
.
Returns
The number of items in the data source.
Exceptions
dataSource
returns a null DataSourceView.
-or-
dataSource
is not an ICollection and cannot return a total row count.
-or-
dataBinding
is false
and dataSource
does not implement the ICollection interface.
-or-
dataSource
does not implement the ICollection interface and AllowPaging is set to true
.
Remarks
The CreateChildControls method is a helper method called by the DetailsView control to create the control hierarchy for the control.
Notes to Inheritors
When extending the DetailsView class, you can override this method to create your own control hierarchy.