您的位置:首页 > 其它

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)];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: