Initializes the System.Web.UI.WebControls.BoundField object.
- enableSorting
- true if sorting is supported; otherwise, false.
- control
- The data control that owns the System.Web.UI.WebControls.BoundField.
false in all cases.
The BoundField.Initialize(bool, System.Web.UI.Control) method is called by the data control with which the System.Web.UI.WebControls.BoundField 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 this 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.BoundField object. Implement this method if your System.Web.UI.WebControls.BoundField-derived type requires any object initialization before it populates System.Web.UI.WebControls.TableCell objects with data or controls in the BoundField.InitializeCell(DataControlFieldCell, DataControlCellType, DataControlRowState, int) method.