ImageField.InitializeCell(DataControlFieldCell, DataControlCellType, DataControlRowState, Int32) 方法

定义

使用指定单元格类型、行状态和行索引初始化指定的 DataControlFieldCell 对象。Initializes the specified DataControlFieldCell object with the specified cell type, row state, and row index.

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

要初始化的 DataControlFieldCellThe DataControlFieldCell to initialize.

cellType
DataControlCellType

DataControlCellType 值之一。One of the DataControlCellType values.

rowState
DataControlRowState

DataControlRowState 值之一。One of the DataControlRowState values.

rowIndex
Int32

行的索引(索引从零开始)。The zero-based index of the row.

注解

InitializeCell方法由 ImageField 派生类型实现,以将文本和控件添加到 DataControlFieldCell 数据控件的对象,该对象使用表显示用户界面 (UI) 。The InitializeCell method is implemented by ImageField-derived types to add text and controls to a DataControlFieldCell object of a data control that uses tables to display a user interface (UI). 调用控件的方法时,这些数据控件逐行创建完整的表结构 CreateChildControlsThese data controls create the complete table structure row-by-row when the control's CreateChildControls method is called. InitializeCell方法由 InitializeRow 数据控件(如和)的方法调用 DetailsView GridViewThe InitializeCell method is called by the InitializeRow method of data controls such as DetailsView and GridView.

编写自定义数据绑定控件时,请调用此方法,该控件使用 DataControlFieldCell 对象初始化包含数据或控件的表结构的单元格。Call this method when you are writing a custom data-bound control that uses DataControlFieldCell objects to initialize the cells of the table structure with data or controls. 在编写派生类时实现此方法 ImageFieldImplement this method when you are writing an ImageField-derived class.

适用于

另请参阅