System.Web.UI.WebControls.DataControlField.Initialize Method

Performs basic instance initialization for a data control field.

Syntax

public virtual bool Initialize (bool sortingEnabled, System.Web.UI.Control control)

Parameters

sortingEnabled
A value that indicates whether the control supports the sorting of columns of data.
control
The data control that owns the System.Web.UI.WebControls.DataControlField.

Returns

Always returns false.

Remarks

The control that the System.Web.UI.WebControls.DataControlField object is associated with calls the DataControlField.Initialize(bool, System.Web.UI.Control) method to initialize the field before it is added to a rows collection. Data controls such as System.Web.UI.WebControls.DetailsView and System.Web.UI.WebControls.GridView call the DataControlField.Initialize(bool, System.Web.UI.Control) method in their CreateChildControls methods before calling other methods such as CreateRow to create specific rows with data.

Call this method when you are writing a custom data-bound control that uses System.Web.UI.WebControls.DataControlFieldCell objects to perform basic initialization for any System.Web.UI.WebControls.DataControlField objects. Implement this method if your derived type requires any object initialization before it populates System.Web.UI.WebControls.DataControlFieldCell objects with data or controls in the DataControlField.InitializeCell(DataControlFieldCell, DataControlCellType, DataControlRowState, int) method.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0