Categories
ASP.NET

Gridview – Getting the RowIndex

The following syntax sets the rowindex equal to the specific row number:

int rowindex = ((GridViewRow)((Control)e.CommandSource).Parent.Parent).RowIndex;