日期:2014-05-17  浏览次数:20939 次

WPF,请教DataGrid的复合表头是怎么做的?
DataGrid控件的复合表头是怎么做的,各位有没有资料。
我给列写了数据模板。如下:

<Window.Resources>
    <Style x:Key="标题1">
        <Setter Property="DataGridColumnHeader.ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid HorizontalAlignment="Left">
                        <Grid.RowDefinitions>
                            <RowDefinition></RowDefinition>
                            <RowDefinition></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition></ColumnDefinition>
                            <ColumnDefinition></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Border Grid.ColumnSpan="2" BorderBrush="Black" BorderThickness="0,0,0,1">
                            <TextBlock Text="姓名" TextAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                        <Border Grid.Row="1" BorderBrush="Black" BorderThickness="0,0,1,0">