我用了GridView的ButtonField在表中做了个按钮,但是他的事件ViewCommandEventArgs不能提供该按钮所在列的下标的参数~
这样我就不能操作该按钮所在行的数据了~~~该怎么做
这样我就不能操作该按钮所在行的数据了~~~该怎么做
解决方案 »
- mvc3 子页和母页的 js 执行顺序问题
- 关于判断session是否为空的问题。
- 正则表达式
- |M| 刚才我的一个问题和图片路径有关 慕白兄 说不要用绝对路径 有点不明 是不是aspx用想对路径 ascx用绝对路径
- |M| 疯了500求救:ASP.NET中获取客户端的默认打印机
- SqlDataSource.Select的触发问题
- 绑定数据时出现的问题!
- 如何取得DataTable里用SELECT过滤的DataRow里边的某一列数据值
- 求教解决方案??????????
- aspnet_client文件夹在程序中的作用是什么
- 很急的问题
- 请问和PHP自带的md5函数相应的ASP.net函数是什么?
如Button
首先, 可以在GridView中增加一隐藏字段, 例如: <asp:LinkButton ID="btnStatus" runat="server" CommandName="Action" Visible="false" CommandArgument="<%# ((GridViewRow)Container).RowIndex %>"></asp:LinkButton> 这里主要设置行的Index.
然后在GridView有一个RowCommand(object sender, GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = dgvPermitList.Rows[index];
Label lblLabel1 = (Label)row.FindControl(("lblLabel1"));
}