How to find column name with column index in DataGridView?

Viewed 107062

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.

6 Answers

In a single row of code

String name = dataGridView1.Columns[dataGridView1.CurrentCell.ColumnIndex].Name;

It may be helps you:

String s = dataGridView1.Columns[Index].HeaderText;
Related