title: WPF dataGrid super Header for multiple columns
body: <p>I want to do Header for multiple columns in WPF <code>DataGrid</code>. I tried with Header template but it will display Header for one column.</p>
  
  <p>Below XAML I have tried:</p>
  
  <pre><code>  &lt;DataGrid&gt;
          &lt;DataGrid.Columns&gt;
              &lt;DataGridTextColumn&gt;
                  &lt;DataGridTextColumn.HeaderTemplate&gt;
                      &lt;DataTemplate&gt;
                          &lt;StackPanel&gt;
                              &lt;TextBlock&gt;Column 1&lt;/TextBlock&gt;
                              &lt;TextBlock&gt;xyz&lt;/TextBlock&gt;
                          &lt;/StackPanel&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/DataGridTextColumn.HeaderTemplate&gt;
              &lt;/DataGridTextColumn&gt;
              &lt;DataGridTextColumn Header="Header" /&gt;
          &lt;/DataGrid.Columns&gt;
      &lt;/DataGrid&gt;
  </code></pre>
  
  <p>I am also attaching the My expected result screen shoot:</p>
  
  <pre><code> &lt;Grid Width="Auto"&gt;
                      &lt;Grid.RowDefinitions&gt;
                          &lt;RowDefinition /&gt;
                          &lt;RowDefinition /&gt;
                      &lt;/Grid.RowDefinitions&gt;
                      &lt;Grid.ColumnDefinitions&gt;
                          &lt;ColumnDefinition /&gt;
                          &lt;ColumnDefinition /&gt;
                          &lt;ColumnDefinition /&gt;
                      &lt;/Grid.ColumnDefinitions&gt;
                      &lt;toolkit:DataGrid x:Name="problemsList"
                                        MinHeight="205"
                                        MaxHeight="205"
                                        Margin="3"
                                        VerticalAlignment="Top"
                                        AutoGenerateColumns="False"
                                        CanUserAddRows="False"
                                        CanUserDeleteRows="False"
                                        CanUserReorderColumns="False"
                                        CanUserResizeColumns="True"
                                        CanUserResizeRows="False"
                                        ColumnHeaderStyle="{StaticResource GridColumnHeaderStyle}"
                                        HorizontalScrollBarVisibility="Visible"
                                        ItemsSource="{Binding FisapCorrections}"
                                        MouseLeftButtonUp="problemsList_MouseLeftButtonUp"
                                        SelectionMode="Single"
                                        Sorting="problemsList_Sorting"
                                        VerticalScrollBarVisibility="Auto"&gt;
                          &lt;toolkit:DataGrid.Columns&gt;
                              &lt;toolkit:DataGridTemplateColumn MinWidth="50"
                                                              CellTemplate="{StaticResource RowSelected}"
                                                              Header="Select" /&gt;
                              &lt;toolkit:DataGridTextColumn MinWidth="88"
                                                          Binding="{Binding StudentName}"
                                                          Header="Student Name"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTextColumn x:Name="dgtcSSN"
                                                          MinWidth="50"
                                                          Binding="{Binding SSN}"
                                                          Header="SSN"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTextColumn x:Name="dgtcStuNum"
                                                          MinWidth="50"
                                                          Binding="{Binding StuNum}"
                                                          Header="StuNum"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTextColumn MinWidth="80"
                                                          Binding="{Binding Campus}"
                                                          Header="Campus"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTextColumn Width="50"
                                                          MinWidth="50"
                                                          Binding="{Binding BadModel,
                                                                            Converter={StaticResource ToEmptyStringConverter}}"
                                                          Header="BadModel"
                                                          HeaderTemplate="{StaticResource DepModelHeaderTemplate}"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTextColumn Width="72"
                                                          MinWidth="72"
                                                          Binding="{Binding BadPellEnrollStatus,
                                                                            Converter={StaticResource ToEmptyStringConverter}}"
                                                          CanUserReorder="False"
                                                          Header="BadPellEnrollStatus"
                                                          HeaderTemplate="{StaticResource EnrollStatusHeaderTemplate}"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTextColumn Width="75"
                                                          MinWidth="75"
                                                          Binding="{Binding DupePell,
                                                                            Converter={StaticResource ToEmptyStringConverter}}"
                                                          Header="DupePell"
                                                          HeaderTemplate="{StaticResource DupStudentPellHeaderTemplate}"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTextColumn Width="80"
                                                          MinWidth="80"
                                                          Binding="{Binding BadTransactionId,
                                                                            Converter={StaticResource ToEmptyStringConverter}}"
                                                          Header="BadTransactionId"
                                                          HeaderTemplate="{StaticResource InvTransactionIDHeaderTemplate}"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTextColumn Width="40"
                                                          MinWidth="40"
                                                          Binding="{Binding HasNoISIR,
                                                                            Converter={StaticResource ToEmptyStringConverter}}"
                                                          Header="HasNoISIR"
                                                          HeaderTemplate="{StaticResource NoISIRHeaderTemplate}"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTextColumn Width="75"
                                                          MinWidth="75"
                                                          Binding="{Binding GradWithSEOG,
                                                                            Converter={StaticResource ToEmptyStringConverter}}"
                                                          Header="GradWithSEOG"
                                                          HeaderTemplate="{StaticResource NotEligxSEOGHeaderTemplate}"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTextColumn Width="100"
                                                          MinWidth="100"
                                                          Binding="{Binding GradIsDependent,
                                                                            Converter={StaticResource ToEmptyStringConverter}}"
                                                          Header="GradIsDependent"
                                                          HeaderTemplate="{StaticResource GradWithDepModelHeaderTemplate}"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTextColumn Width="60"
                                                          MinWidth="60"
                                                          Binding="{Binding NoClasses,
                                                                            Converter={StaticResource ToEmptyStringConverter}}"
                                                          Header="NoClasses"
                                                          HeaderTemplate="{StaticResource NoClassesHeaderTemplate}"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTextColumn Width="65"
                                                          MinWidth="65"
                                                          Binding="{Binding Ineligible}"
                                                          Header="Ineligible"
                                                          HeaderTemplate="{StaticResource SchoolStatusHeaderTemplate}"
                                                          IsReadOnly="True" /&gt;
                              &lt;toolkit:DataGridTemplateColumn IsReadOnly="True"&gt;
                                  &lt;toolkit:DataGridTemplateColumn.CellTemplate&gt;
                                      &lt;DataTemplate&gt;
                                      &lt;TextBlock Text="Main Header Text" Grid.columnSpan="3" Grid.Row="0" Grid.Column="0"/&gt;
                                      &lt;TextBlock Text="Text 1" grid.Column="0" grid.Row="1"/&gt;
                                      &lt;TextBlock Text="Text 2" grid.Column="1" grid.Row="1"/&gt;
                                      &lt;TextBlock Text="Text 3" grid.Column="2" grid.Row="1"/&gt;
                                      &lt;/DataTemplate&gt;
                                  &lt;/toolkit:DataGridTemplateColumn.CellTemplate&gt;
                                  &lt;toolkit:DataGridTemplateColumn.HeaderTemplate&gt;
                                      &lt;DataTemplate&gt;
                                          &lt;TextBlock Text="Missing from FISAP Summary Part II Section F"
                                             TextWrapping="Wrap"
                                             Width="200"/&gt;
                                      &lt;/DataTemplate&gt;
                                  &lt;/toolkit:DataGridTemplateColumn.HeaderTemplate&gt;
                              &lt;/toolkit:DataGridTemplateColumn&gt;
                          &lt;/toolkit:DataGrid.Columns&gt;
                      &lt;/toolkit:DataGrid&gt;
                      &lt;CmcControls:WaitingControl x:Name="waitingControlOnGrid"
                                                  HorizontalAlignment="Center"
                                                  VerticalAlignment="Center" /&gt;
                  &lt;/Grid&gt;
  </code></pre>
  
  <p>I want to add the Expected result in the Last of the Grid
  <img src="https://i.stack.imgur.com/EDNJy.png" alt="enter image description here"></p>