0

こんにちは私はasp.netプロジェクトに取り組んでいます。

データベースとグリッドビューを使用しています。作成時に各グリッドビュー行の最初のセルの名前を取得したい。なぜこれが機能しないのですか?

protected void CustomersGridView_RowCreated(Object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Response.Write(e.Row.Cells[0].Text);
            }
}
4

1 に答える 1

0

gridview の各行の最初の列のテキストを取得する場合は、次のようにコードを使用します。

protected void GridView1_RowDataBound(オブジェクト送信者、GridViewRowEventArgs e) {

    Response.Write(e.Row.Cells[0].Text);
}
于 2013-01-07T12:56:53.203 に答える