<Window x:Class="_214416_MergedColumns.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" xmlns:GridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView" Title="Window1" Height="600" Width="800">
    <Window.Resources>
        <Style x:Key="mergedHeaderStyle" TargetType="GridView:GridViewHeaderCell">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="GridView:GridViewHeaderCell">
                        <Grid Background="{TemplateBinding Background}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="20" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Border BorderBrush="#FFB3B3B3" BorderThickness="0, 0, 0, 1">
                                <TextBlock Text="Person Details" HorizontalAlignment="Center" Grid.Row="0" FontWeight="Bold" />
                            </Border>
                            <Grid Grid.Row="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Border BorderBrush="#FFB3B3B3" BorderThickness="0, 0, 1, 0" Padding="3" Grid.Column="0" >
                                    <TextBlock Text="FirstName" SnapsToDevicePixels="True" HorizontalAlignment="Center" RenderTransformOrigin=".5, .5" FontWeight="Bold">
                                        <TextBlock.LayoutTransform>
                                            <RotateTransform Angle="-90" />
                                        </TextBlock.LayoutTransform>
                                    </TextBlock>
                                </Border>
                                <Border BorderBrush="#FFB3B3B3" BorderThickness="0, 0, 1, 0" Padding="3" Grid.Column="1">
                                    <TextBlock Text="LastName" SnapsToDevicePixels="True" HorizontalAlignment="Center" RenderTransformOrigin=".5, .5" FontWeight="Bold">
                                        <TextBlock.LayoutTransform>
                                            <RotateTransform Angle="-90" />
                                        </TextBlock.LayoutTransform>
                                    </TextBlock>
                                </Border>
                                <Border BorderBrush="#FFB3B3B3" BorderThickness="0, 0, 1, 0" Padding="3" Grid.Column="2">
                                    <TextBlock Text="Age" SnapsToDevicePixels="True" HorizontalAlignment="Center" RenderTransformOrigin=".5, .5" FontWeight="Bold">
                                        <TextBlock.LayoutTransform>
                                            <RotateTransform Angle="-90" />
                                        </TextBlock.LayoutTransform>
                                    </TextBlock>
                                </Border>
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="mergedCellStyle" TargetType="GridView:GridViewCell">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="GridView:GridViewCell">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0, 0, 1, 1" Grid.Column="0">
                                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding FirstName}" />
                            </Border>
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0, 0, 1, 1" Grid.Column="1">
                                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding LastName}" />
                            </Border>
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0, 0, 1, 1" Grid.Column="2">
                                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Age}" />
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <telerik:RadGridView x:Name="radGridView1" AutoGenerateColumns="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn UniqueName="Age" />
                <telerik:GridViewDataColumn CellStyle="{StaticResource mergedCellStyle}" 
                                            HeaderCellStyle="{StaticResource mergedHeaderStyle}"
                                            DataMemberBinding="{Binding FirstName}"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>
