how to get cell value from gridview without using cell index? Let say the first column name in my table is \"RowNumber\".
instead of using
string nam
You could cast the GridViewRow's DataItem property into a DataRowView, and then reference the column names:
DataRowView rowView = (DataRowView)GridView1.Rows[0].DataItem;
string name = rowView["RowNumber"].ToString();
You can't do this from the Cells collection, because they are just TableCell objects, and they don't know anything about the underlying data.
The DataItem property represents the values in that row from the underlying datasource, so that's what you want to deal with.