获取Gridview行索引

在GridView自定义执行控件操作的时候,获取操作行索引的方法如下
int index = ((GridViewRow)(((Button)(e.CommandSource)).Parent.Parent)).RowIndex;
如果用GridView自带按钮执行操作时
int i = Convert.ToInt32(e.CommandArgument);
posted @ 2008-04-09 14:21  凡的世界  阅读(1125)  评论(0编辑  收藏  举报