System.Web.UI.WebControls.ButtonField.Initialize Method

Initializes the current System.Web.UI.WebControls.ButtonField object.

Syntax

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

Parameters

sortingEnabled
true to enable sorting; otherwise, false.
control
The data control that owns the System.Web.UI.WebControls.ButtonField.

Returns

false, which indicates the control does not need to rebind to the data.

Remarks

The ButtonField.Initialize(bool, System.Web.UI.Control) method is called by the data control with which the System.Web.UI.WebControls.ButtonField object is associated to perform basic object initialization for instances of the field, before the field is ever 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 other methods, such as CreateRow, are called to create specific rows with data.

Call The ButtonField.Initialize(bool, System.Web.UI.Control) method when you are writing a custom data-bound control that uses System.Web.UI.WebControls.TableCell objects to perform basic initialization for a System.Web.UI.WebControls.ButtonField object. Implement this method if your System.Web.UI.WebControls.ButtonField-derived type requires any object initialization before it populates System.Web.UI.WebControls.TableCell objects with data or controls in the ButtonField.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