ListView.CreateChildControls ListView.CreateChildControls ListView.CreateChildControls ListView.CreateChildControls Method

Definition

Creates the control hierarchy that is used to render the ListView control.

Overloads

CreateChildControls() CreateChildControls() CreateChildControls() CreateChildControls()

Creates the control hierarchy that is used to render the ListView control, based on the values that are stored in view state.

CreateChildControls(IEnumerable, Boolean) CreateChildControls(IEnumerable, Boolean) CreateChildControls(IEnumerable, Boolean) CreateChildControls(IEnumerable, Boolean)

Creates the control hierarchy that is used to render the ListView control by using the specified data source.

CreateChildControls() CreateChildControls() CreateChildControls() CreateChildControls()

Creates the control hierarchy that is used to render the ListView control, based on the values that are stored in view state.

protected public:
 override void CreateChildControls();
protected internal override void CreateChildControls ();
override this.CreateChildControls : unit -> unit
Protected Friend Overrides Sub CreateChildControls ()

Remarks

The CreateChildControls() method is a helper method that is used by the ListView class to create the control hierarchy. This overload of the method creates the control hierarchy based on values from view state, instead of directly from the data source.

See also

CreateChildControls(IEnumerable, Boolean) CreateChildControls(IEnumerable, Boolean) CreateChildControls(IEnumerable, Boolean) CreateChildControls(IEnumerable, Boolean)

Creates the control hierarchy that is used to render the ListView control by using the specified data source.

protected:
 virtual int CreateChildControls(System::Collections::IEnumerable ^ dataSource, bool dataBinding);
protected virtual int CreateChildControls (System.Collections.IEnumerable dataSource, bool dataBinding);
override this.CreateChildControls : System.Collections.IEnumerable * bool -> int
Protected Overridable Function CreateChildControls (dataSource As IEnumerable, dataBinding As Boolean) As Integer

Parameters

dataSource
IEnumerable IEnumerable IEnumerable IEnumerable

An object that contains the data source for the ListView control.

dataBinding
Boolean Boolean Boolean Boolean

true to indicate that the child controls are bound to data; false to indicate that the control will re-create itself from view state during a postback.

Returns

The number of items that are created.

Exceptions

dataSource returns null for DataSourceView.

-or-

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

-or-

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

-or-

The ListView control does not have a group placeholder specified.

-or-

The ListView control does not have an item placeholder specified.

Remarks

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

Note

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

See also

Applies to