I want to find column name in DataGridView
.
I have column index. How can I find it.
dGVTransGrid.CurrentCell.ColumnIndex
: I want it's column name.
Plz help.
Thanks.
There may be a better way, but why don't you just ask the DataGridView what the column with that index is called?
int columnIndex = dGVTransGrid.CurrentCell.ColumnIndex;
string columnName = dGVTransGrid.Columns[columnIndex].Name;