I am using one ButtonField in Gridview1.If i click that buttonfield it will be fill the next gridview2.
So i am using rowcommand for this purpose
if (e.CommandName == "nextgrid")
string orderid = Convert.ToString(e.CommandArgument);
fillgrid is the fun to fill second grid.here this orderid takes just row value only that is 1 or 2 not its original value like ID1234.
if i am using this in row command
string orderid = Convert.ToString(grdorders.DataKeys[e.RowIndex].Value);
I got the error "Error GridViewCommandEventArgs' does not contain a definition for 'RowIndex'
Where i can use this RowIndex or any other way to get this buttonfield value and use this value to fill second grid.