GridView.CreateChildControls(IEnumerable, Boolean) Method

Definition

Creates the control hierarchy used to render the GridView control using the specified data source.

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 contains the data source for the GridView control.

dataBinding
Boolean

true to indicate that the child controls are bound to data; otherwise, false.

Returns

Int32

The number of rows created.

Exceptions

dataSource returns a null DataSourceView.

-or-

dataSource does not implement the ICollection interface and cannot return a TotalRowCount.

-or-

AllowPaging is true and dataSource does not implement the ICollection interface and cannot perform data source paging.

-or-

dataSource does not implement the ICollection interface and dataBinding is set to false.

Remarks

The CreateChildControls method is used to create the control hierarchy of the GridView control.

Note

This method is used primarily by control developers to extend the GridView control.

Applies to

See also