1

我有一个 wpf 网格,我想合并两个列标题。我尝试使用下面的代码,这里的问题是列生成为 2,但在单元格中,为什么每个列的网格线不可见。可以任何机构都回答了实现这一目标的更好解决方案

<toolkit:DataGridTemplateColumn>
   <toolkit:DataGridTemplateColumn.Header>
      <Grid>
         <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
         </Grid.RowDefinitions>
         <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
         </Grid.ColumnDefinitions>
         <TextBlock Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Center" Text="Missing from FISAP Summary Part II Section F"/>
         <TextBlock Grid.Column="0" Grid.Row="1" Text="A" Width="60" HorizontalAlignment="Center"/>
         <TextBlock Grid.Column="1" Grid.Row="1" Text="C"  Width="60" HorizontalAlignment="Center"/>
         <TextBlock Grid.Column="2" Grid.Row="1" Text="D"  Width="60" HorizontalAlignment="Center"/>
      </Grid>
   </toolkit:DataGridTemplateColumn.Header>
   <toolkit:DataGridTemplateColumn.CellTemplate>
      <DataTemplate>
         <Grid>
            <Grid.ColumnDefinitions>
               <ColumnDefinition/>
               <ColumnDefinition/>
               <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="{Binding Path=A}" Width="60" HorizontalAlignment="Right" />
            <TextBlock Grid.Column="1" Text="{Binding Path=C}" Width="60" HorizontalAlignment="Right" />
            <TextBlock Grid.Column="2" Text="{Binding Path=D}" Width="60" HorizontalAlignment="Right" />
         </Grid>
      </DataTemplate>
   </toolkit:DataGridTemplateColumn.CellTemplate>
</toolkit:DataGridTemplateColumn>

在此处输入图像描述

4

0 回答 0