|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
datagridview headertext ?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 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 > > |
|||||||||||||||||||||||