You can also put the grid row number into one of your grid controls .CommandArgument properties when loading the grid, then retrieve the value on gridview.RowCommand when selected: