Home All Groups Group Topic Archive Search About

datagridview headertext ?

Author
24 Apr 2006 3:49 PM
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

Author
1 May 2006 7:09 PM
Raj Kumar
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

Show quote
"swartzbill2***@yahoo.com" wrote:

> 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
>
>

AddThis Social Bookmark Button