Export (0) Print
Expand All

CompositeDataBoundControl.CreateChildControls Method (IEnumerable, Boolean)

When overridden in an abstract class, creates the control hierarchy that is used to render the composite data-bound control based on the values from the specified data source.

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

abstract CreateChildControls : 
        dataSource:IEnumerable * 
        dataBinding:bool -> int

Parameters

dataSource
Type: System.Collections.IEnumerable

An IEnumerable that contains the values to bind to the control.

dataBinding
Type: System.Boolean

true to indicate that the CreateChildControls(IEnumerable, Boolean) is called during data binding; otherwise, false.

Return Value

Type: System.Int32
The number of items created by the CreateChildControls(IEnumerable, Boolean).

The CreateChildControls() method is a helper method that is used by classes that derive from the CompositeDataBoundControl class to create the control hierarchy for a composite data-bound control. When extending the CompositeDataBoundControl class, you must override the CreateChildControls() method to create your own control hierarchy. For more information on creating a composite control, see Developing Custom ASP.NET Server Controls.

The following code example demonstrates how to override the CreateChildControls(IEnumerable, Boolean) method in a custom control to create the control hierarchy.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft