GridView / RowCommand / e.CommandArgument
2006-11-17 09:40
323 查看
GridView / RowCommand / e.CommandArgument[/b]
In the following GridView’s RowCommand method,
public void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
e.CommandArgument is automatically set to the row index (as a string, not as an int). So if the GridView ID is GridView1, here's an easier solution to get the current RowIndex:
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = GridView1.Rows[Convert.ToInt32 (e.CommandArgument)];
In the following GridView’s RowCommand method,
public void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
e.CommandArgument is automatically set to the row index (as a string, not as an int). So if the GridView ID is GridView1, here's an easier solution to get the current RowIndex:
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = GridView1.Rows[Convert.ToInt32 (e.CommandArgument)];
相关文章推荐
- GridView RowCommand (handle with e.CommandArgument)
- GridView使用DataKeyNames的例子 & CommandArgument传递多个参数 & 获取GridView编辑状态下单元格里的值
- 给GridView模版列中的按钮的CommandArgument属性绑定值及调用 手动绑定和自动代码绑定一样有效
- UserControl with GridView rowCommand not fired
- 给GridView模版列中的按钮的CommandArgument属性绑定值及调用
- GridView RowCommand 获取列值
- GridView RowCommand事件中取得當前行
- GridView使用技巧之:如何在RowCommand里获取模板列里绑定的内容?
- GridView RowCommand 获取列值
- GridView控件CommandArgument 绑定多个参数
- Gridview之RowCommand,ButtonField[add buttons and use the RowCommand event to add custom functionality to the control]
- GridView使用技巧之:如何在RowCommand里获取模板列里绑定的内容?
- GridView中通过CommandArgument传递多个参数的例子
- GridView控件CommandArgument 绑定多个参数
- GridView使用技巧之:如何在RowCommand里获取模板列里绑定的内容?
- 11.17日,GridView 的RowCommand事件中,e.CommandArgument不是行号,那么要取这一行的某一列怎么办
- asp.net gridview 获得 CommandArgument 值
- **GridView**在GridView的RowCommand里取列的值
- 关于GridView中按钮的commandargument使用
- GridView分页后RowCommand出错:索引超出范围