我想选择数据绑定字段值。我得到编译错误说不包含细胞定义
<asp:GridView ID="gvBankDetails" runat="server" AutoGenerateColumns="false" AutoGenerateEditButton="true" OnRowEditing="gvBankDetails_RowEditing" OnRowCancelingEdit="gvBankDetails_RowCancelingEdit" OnRowUpdating="gvBankDetails_RowUpdating">
<Columns>
<asp:BoundField HeaderText="sl no" DataField="id" />
</Columns>
</Gridview>
protected void gvBankDetails_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
string dtr = ((TextBox)gvBankDetails.Cells[0].Controls[0]).Text;
}
答案 0 :(得分:2)
获取网格视图中绑定字段的值
protected void gvBankDetails_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
string strName = ((TextBox)gvBankDetails.Rows[e.RowIndex].Cells[3].Controls[0]).Text;
}
答案 1 :(得分:0)
show queue
索引可能因列号
而不同