从数据视图中取吧!
DataRow yourDataRow=((DataRowView)dgi.DataItem).Row;
string yourID=yourDataRow["id"].ToString();
DataRow yourDataRow=((DataRowView)dgi.DataItem).Row;
string yourID=yourDataRow["id"].ToString();
解决方案 »
- Gridview搜索功能求解
- 命名空间问题
- 如何让ultrawebgrid能固定列宽,并且列内容能自动换行
- 高难度的SQL 语句 ,高手请入(因为急,所以二发啦,斑竹手下留情)
- 求2005读写xml的例子
- Session是否可以用数组,怎么赋值,怎么取值????
- IEWebControl的tabstrip
- 怎样部署ASP.net网站啊
- 关于CSS的小技巧
- ★请问哪里可以下得到Asp.net的网站各项访问数据统计系统???
- 关于<a ipop="从这里开始进入论坛" href="Login.aspx" id="loginlink" runat="server">登录</a> |的问题?
- 我的水晶报表那里出问题了,谢谢
另加一隐藏列存放id,比如第n列
sql[I]=Convert.ToInt32(DataGrid1.Items[i].Cells[n].Text.ToString());或者:
<asp:datagrid ... DataKeyField="id"></asp:datagrid>
然后
sql[I]=Convert.ToInt32(DataGrid1.DataKeys[i]);