<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="C1DataGrid_Demo2010.HeadersMerging" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:c1datagrid="clr-namespace:C1.Silverlight.DataGrid;assembly=C1.Silverlight.DataGrid.5" xmlns:local="clr-namespace:C1DataGrid_Demo2010">
            
    <!--
   // **********************************************************************************
   // Header merging is made by:
   // - disabling standard headers (HeadersVisibility=None)
   // - adding custom rows/columns for the headers that look and behave like headers
   // - standard content cell merging
   // **********************************************************************************
    -->
    <c1datagrid:C1DataGrid x:Name="grid" Grid.Row="1" HeadersVisibility="None" AutoGenerateColumns="False" SelectionMode="MultiRange" CanUserAddRows="False" AlternatingRowBackground="White" RowBackground="White" GridLinesVisibility="All" CanUserFreezeColumns="Left" FrozenTopRowsCount="2" FrozenColumnCount="2">
        <c1datagrid:C1DataGrid.Columns>
            <!-- First two columns must be headers, put several headers using this custom syntax-->
            <c1datagrid:DataGridRowHeaderColumn Header="[Country, Continent]" Binding="{Binding Continent}" />
            <c1datagrid:DataGridRowHeaderColumn Header="[Country, Name]" Binding="{Binding Country}" />

            <c1datagrid:DataGridTextColumn Header="[Final, Champion]" Binding="{Binding First}" />
            <c1datagrid:DataGridTextColumn Header="[Final, Runner-up]" Binding="{Binding Second}" />
            <c1datagrid:DataGridTextColumn Header="[Semi-Finals, Third]" Binding="{Binding Third}" />
            <c1datagrid:DataGridTextColumn Header="[Semi-Finals, Fourth]" Binding="{Binding Fourth}" />
        </c1datagrid:C1DataGrid.Columns>
        <c1datagrid:C1DataGrid.TopRows>
            <!-- Add two rows of headers -->
            <c1datagrid:DataGridColumnHeaderRow />
            <c1datagrid:DataGridColumnHeaderRow />
        </c1datagrid:C1DataGrid.TopRows>
    </c1datagrid:C1DataGrid>                               
</UserControl>