CommandField.InitializeCell 方法

定义

将指定的 DataControlFieldCell 对象初始化为指定的行状态。

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

DataControlFieldCell 初始化的。

cellType
DataControlCellType

其中一个 DataControlCellType 值。

rowState
DataControlRowState

其中一个 DataControlRowState 值。

rowIndex
Int32

包含单元格的行的从零开始的索引。

注解

该方法 InitializeCellDataControlField派生类型实现,用于向使用表显示用户界面(UI)的数据控件的对象添加文本和控件 TableCell 。 调用控件 CreateChildControls 的方法时,这些数据控件会逐行创建完整的表结构。 该方法 InitializeCellInitializeRow 数据控件的方法(如 DetailsViewGridView)调用。

编写使用对象通过数据或控件初始化表结构的单元格的自定义数据绑定控件 TableCell 时调用此方法。 编写 CommandField-derived 类时实现此方法。

适用于

另请参阅