GridView.CreateRow 方法

定義

建立 GridView 控制項中的資料列。

protected:
 virtual System::Web::UI::WebControls::GridViewRow ^ CreateRow(int rowIndex, int dataSourceIndex, System::Web::UI::WebControls::DataControlRowType rowType, System::Web::UI::WebControls::DataControlRowState rowState);
protected virtual System.Web.UI.WebControls.GridViewRow CreateRow (int rowIndex, int dataSourceIndex, System.Web.UI.WebControls.DataControlRowType rowType, System.Web.UI.WebControls.DataControlRowState rowState);
abstract member CreateRow : int * int * System.Web.UI.WebControls.DataControlRowType * System.Web.UI.WebControls.DataControlRowState -> System.Web.UI.WebControls.GridViewRow
override this.CreateRow : int * int * System.Web.UI.WebControls.DataControlRowType * System.Web.UI.WebControls.DataControlRowState -> System.Web.UI.WebControls.GridViewRow
Protected Overridable Function CreateRow (rowIndex As Integer, dataSourceIndex As Integer, rowType As DataControlRowType, rowState As DataControlRowState) As GridViewRow

參數

rowIndex
Int32

要建立之資料列的索引。

dataSourceIndex
Int32

要繫結至資料列之資料來源項目的索引。

rowType
DataControlRowType

其中一個 DataControlRowType 值。

rowState
DataControlRowState

其中一個 DataControlRowState 值。

傳回

使用指定參數建立的 GridViewRow

備註

方法 CreateRow 可用來在 控制項中 GridView 建立資料列。

注意

這個方法主要是由控制項開發人員用來擴充 GridView 控制項。 資料繫結 GridView 控制項會自動產生顯示目標資料所需的資料列。

適用於

另請參閱