BoundField.InitializeCell 方法

定義

初始化指定的 TableCell 物件為指定的資料列狀態。

public:
 override void InitializeCell(System::Web::UI::WebControls::DataControlFieldCell ^ cell, System::Web::UI::WebControls::DataControlCellType cellType, System::Web::UI::WebControls::DataControlRowState rowState, int rowIndex);
public override void InitializeCell (System.Web.UI.WebControls.DataControlFieldCell cell, System.Web.UI.WebControls.DataControlCellType cellType, System.Web.UI.WebControls.DataControlRowState rowState, int rowIndex);
override this.InitializeCell : System.Web.UI.WebControls.DataControlFieldCell * System.Web.UI.WebControls.DataControlCellType * System.Web.UI.WebControls.DataControlRowState * int -> unit
Public Overrides Sub InitializeCell (cell As DataControlFieldCell, cellType As DataControlCellType, rowState As DataControlRowState, rowIndex As Integer)

參數

cell
DataControlFieldCell

要初始化的 TableCell

cellType
DataControlCellType

其中一個 DataControlCellType 值。

rowState
DataControlRowState

其中一個 DataControlRowState 值。

rowIndex
Int32

資料列之以零起始的索引。

備註

方法 InitializeCell 是由 BoundField 衍生型別實作,可將文字和控制項新增至 TableCell 資料控制項的物件,該物件會使用資料表來顯示使用者介面 (UI) 。 當呼叫 控制項 CreateChildControls 的 方法時,這些資料控制項會逐列建立完整的資料表結構。 方法 InitializeCell 是由 InitializeRow 和 等 DetailsView GridView 資料控制項的 方法呼叫。

當您撰寫自訂資料繫結控制項,以使用 物件以資料 TableCell 或控制項初始化資料表結構的儲存格時,請呼叫這個方法。 當您撰寫衍生類別時,請實 BoundField 作這個方法。

適用於

另請參閱