DataControlField.Initialize(Boolean, Control) 方法

定義

執行資料控制項欄位的基本執行個體初始化。Performs basic instance initialization for a data control field.

public:
 virtual bool Initialize(bool sortingEnabled, System::Web::UI::Control ^ control);
public virtual bool Initialize (bool sortingEnabled, System.Web.UI.Control control);
abstract member Initialize : bool * System.Web.UI.Control -> bool
override this.Initialize : bool * System.Web.UI.Control -> bool
Public Overridable Function Initialize (sortingEnabled As Boolean, control As Control) As Boolean

參數

sortingEnabled
Boolean

值,表示控制項是否支援資料的資料行排序。A value that indicates whether the control supports the sorting of columns of data.

control
Control

擁有 DataControlField 的資料控制項。The data control that owns the DataControlField.

傳回

Boolean

一律傳回 falseAlways returns false.

備註

與物件相關聯的控制項,會在將 DataControlField Initialize 欄位加入至資料列集合之前,呼叫方法來初始化該欄位。The control that the DataControlField object is associated with calls the Initialize method to initialize the field before it is added to a rows collection. 之類的資料控制項會 DetailsView GridView Initialize 在呼叫其他方法之前,在其方法中呼叫方法, CreateChildControls 例如 CreateRow 建立具有資料的特定資料列。Data controls such as DetailsView and GridView call the Initialize method in their CreateChildControls methods before calling other methods such as CreateRow to create specific rows with data.

當您撰寫的自訂資料繫結控制項使用 DataControlFieldCell 物件來執行任何物件的基本初始化時,請呼叫這個方法 DataControlFieldCall this method when you are writing a custom data-bound control that uses DataControlFieldCell objects to perform basic initialization for any DataControlField objects. 如果您的衍生型別需要任何物件初始化,才能將 DataControlFieldCell 方法中的資料或控制項填入物件,請執行此方法 InitializeCellImplement this method if your derived type requires any object initialization before it populates DataControlFieldCell objects with data or controls in the InitializeCell method.

適用於