datagridview headertext ?

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top