Check out example codes for "c# get gridview DataKeyNames". It will help you in understanding the concepts better.
Code Example 1
foreach (GridViewRow row in grid.Rows)
{
int id = Convert.ToInt32(grid.DataKeys[row.RowIndex].Value.ToString());
}
Learn ReactJs, React Native from akashmittal.com