Initializes the current System.Web.UI.WebControls.ButtonField object.
- sortingEnabled
- true to enable sorting; otherwise, false.
- control
- The data control that owns the System.Web.UI.WebControls.ButtonField.
false, which indicates the control does not need to rebind to the data.
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.