In a WPF datagrid is it possible to group column headings?
What I\'m after is
| Column 1 | Column 2 | Column 3|
| a b c | a b c | a b c |
|
This is an old thread, but I thought I should share how I did it.
In my application, I want to display three columns of date entries, under a single column header, "Maintenance Fee Dates." I created a single column, with two DataTemplates, one for display and one for editing:
Then I define the column as a DataGridTemplateColumn, pointing at the DataTemplates above:
....
....
Since the DataTemplate is laid out with a Grid that has three fixed-length columns, I get three nice columns of dates (or DatePickers when editing) under the single column header.
Horizontal Gridlines can be handled by the Grid. To have vertical Gridlines between the three columns, just put the middle column's control in a Border control. Set the Border control to the same width as the Grid column, display only its right and left borders, and set its BorderBrush to match the color of the DataGrid's Gridlines: