WPF DataGrid Group Columns

Feb 24, 2010 at 1:56 PM
Edited Feb 24, 2010 at 2:04 PM

Hello Everyone,

I would like to be able to group DataGridTextColumn's.

For example:

Image and video hosting by TinyPic

Basically Monday, Tuesday, Wednesday is a master column, then under those you have 1, 2, 3 columns.  The D1, D2, D3, etc would be the data.

I do not need any type of sorting ability or rearranging abilities.  All I would like to do is make it easier for the people to read the data.

Any help is greatly appreciated!




Feb 25, 2010 at 9:41 PM

I had a similar problem and I ended up creating the master columns outside of the datagrid aligning them with their columns in width a syncing the scrollbars...

Had hoped for a nicer solution but since you can't (?) make a ColumnHeaderStyle that encloses more than one column I don't see any other way....

Feb 25, 2010 at 9:43 PM

Can you post an example?


Not sure how you would create a master coulmn and keep the same visual styling.



Feb 26, 2010 at 11:18 AM

Well you are right - I can't keep the same visual styling... that did not matter in my case since the column headers needed to be interactive and - well look different than the rest of the table anyway ;)


Sorry I can't post an example because I don't have it here... and it's quite bloated for an example... but I will have a look in the next few days if I find something good to demonstrate...