datagridview headertext ?

  • Thread starter Thread starter swartzbill2000
  • Start date Start date
S

swartzbill2000

Hello,
I have a DataGridView that is bound to a table in a DataSet. I want a
tab-separated String containing the HeaderText from all the columns in
the DataGridView. Is there a property or method of a DataGridView or
maybe the columns collection that I can use, or should I just write the
code myself?
Bill
 
If this is related to WinForms then maybe the following code will help:
StringBuilder headerText = new StringBuilder();
headerText.Length = 0;
foreach (DataGridViewColumn column in this.dgrTest.Columns)
{
headerText.Append(column.HeaderText);
headerText.Append("\t");
}

Regards,
Raj
 
Back
Top