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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sam HobbsRank #107 · 20.5K reputationPosted Apr 5, 2010, 8:02 AM EDT
Do you need a header that spans multiple columns or a header for individual columns that have multiple lines?
Rujuta133 reputationPosted Apr 4, 2010, 10:19 PM EDT
http://blogs.msdn.com/mattdotson/articles/541795.aspx
GustavoRank #1,990 · 732 reputationPosted Apr 4, 2010, 11:21 PM EDT
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.
Rujuta133 reputationPosted Apr 5, 2010, 3:00 AM EDT
GustavoRank #1,990 · 732 reputationPosted Apr 5, 2010, 8:34 AM EDT
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.
GustavoRank #1,990 · 732 reputationPosted Apr 5, 2010, 8:38 AM EDT
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.
Sam HobbsRank #107 · 20.5K reputationPosted Apr 10, 2010, 9:36 AM EDT
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";
GustavoRank #1,990 · 732 reputationPosted Apr 10, 2010, 11:32 AM EDT
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 HobbsRank #107 · 20.5K reputationPosted Apr 10, 2010, 11:28 PM EDT
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.