protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string id = GridView1.DataKeys[e.RowIndex].Value.ToString();
}前提条件是在GridView中设置过DataKeyNames属性
<asp:GridView ID="GridView1" runat="server" DataKeyNames="id" ...
{
string id = GridView1.DataKeys[e.RowIndex].Value.ToString();
}前提条件是在GridView中设置过DataKeyNames属性
<asp:GridView ID="GridView1" runat="server" DataKeyNames="id" ...
DataView.Table 属性可以得到此DataView对应的那个DataTable。
DataView的行叫DataRowView,可以从DataRowView直接通过DataRowView.Row
属性得到此DataRowView对应的DataRow了解下上面说的关系,在当前行里进行相关的转换 到 datarow ,这样你就可以进行相关的行 的某列了如
DataRowView drw = (DataRowView)e.Item.DataItem;
DataRow dr = drw.Row;
使用
dr["IsSuper"].ToString()
不好意思我还是没有看懂
是使用e.item.DataItem检索,然后使用drv.Row检索到该行
然后用dr["字段名"]取得该行的值是吗?
所以没有你说的e.item属性