How do you avoid using dataGrid.Rows[x].Cells[y].Value of a data grid when accessing their values? I want to use descriptive names to refer to cell values, and not indices.
How do you avoid using dataGrid.Rows[x].Cells[y].Value of a data grid when accessing their values?
Share
What would be a descriptive name for the nth item in
Rows? I think you’re stuck with using a 0-based index sinceRowsdoesn’t have a string-based indexer.Once you have a
DataGridViewRowyou can index into the cells using astringvalue: