Hello:
Is there a way to add a second header line to a dataGridView?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Apr 5, 2010, 12:02 PM
Do you need a header that spans multiple columns or a header for individual columns that have multiple lines?
Sam HobbsPosted Apr 11, 2010, 3:28 AM
As for how I found it, I looked in the MSDN documentation. It sometimes takes time but when I did I found other stuff that would also be useful. It helps to take time to look at the documentation.
GustavoPosted Apr 10, 2010, 3:32 PM
The line: dataGridView1.Columns[0].HeaderText = "CHARACTER\r\nMAXIMUM\r\nLENGTH";
Does not allow me to load data into the dataGridView. Strange.
BTW: How did you find the object:dataGridView1.ColumnHeadersDefaultCellStyle.WrapMode
Did you just knwo it or did you surf like crazy or is it in a book you have?
The only way I would of been able was to look at all the options/functions... and there is like 400 of them...
Sam HobbsPosted Apr 10, 2010, 1:36 PM
DataGridViewTriState.True;
Then you can change header text in a manner such as the following and you get a new line for each "\r\n".
"CHARACTER\r\nMAXIMUM\r\nLENGTH";
GustavoPosted Apr 5, 2010, 12:38 PM
Have you ever looked at PebbleReports. I think its a pretty cool tool. Check it out at www.PebbleReports.com
I really like it. Now I have to figure out how to use the *.rdl file in the VS2008 project.
GustavoPosted Apr 5, 2010, 12:34 PM
I have finally got back to this issue. I am jumping around like crazy.
BTW: How are the quakes?
YES, you are right. I need it for a DataGridView. reading other articles on the web, I was getting confused about GridView and DataGridView. I thought at times they where the same but then at times I thought they where different.
Yes, a header (column header) for individual columns.
Reason is: Some columns headers are to long like "CHARACTER_MAXIMUM_LENGTH". I would like to parse them to "CHARACTER", "MAXIMUM", "LENGTH". The put them on a separate row/header for the column.
RujutaPosted Apr 5, 2010, 7:00 AM
GustavoPosted Apr 5, 2010, 3:21 AM
Thanks... I looked at it. I am not sure on how to implement it, but it looks like what I need. I will play with it and get it to work for me. Thanks.
RujutaPosted Apr 5, 2010, 2:19 AM
http://blogs.msdn.com/mattdotson/articles/541795.aspx