Tuesday, July 31, 2012

How to get RowIndex on GridViewRowcommand Event

.aspx page
CommandArgument='<%# DataBinder.Eval(Container, "RowIndex") %>'


.CS page (on row commond)
int iRowIndex = Convert.ToInt32(e.CommandArgument.ToString())
OR
Dim iRowIndex As Integer
iRowIndex = CType(CType(sender, Control).Parent.Parent, GridViewRow).RowIndex