I am writing a class to print the contents of a DataGridView, however I'm having trouble extracting the names of the header row. I'm using .NET 3.0.
Is there an easy way of doing this?
I have seen some methods whereby the controls collections are used, E.g.
columnTitle = myDataGrid.Controls[0].Controls[0].Text;
however I've yet to get this to work either.
To extract the table contents I use:
cellText = m_dataGrid[row.Index, col.Index].Value.ToString();
Is there not a similar way of accessing the column names...?