2
我有此XAML代碼:爲什麼單元格標題和單元格內容未在數據網格中對齊?
<DataGridTextColumn Header="number" Binding="{Binding Path=Number, Mode=OneWay}" Width="70" CanUserResize="False" >
<DataGridTextColumn.CellStyle>
<Style>
<Setter Property="FrameworkElement.HorizontalAlignment" Value="Center" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="Status" Binding="{Binding Path=ProcessingState}" Width="100">
<DataGridTextColumn.CellStyle>
<Style>
<Setter Property="FrameworkElement.HorizontalAlignment" Value="Center" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
但是當它顯示在屏幕上,它生成這樣的觀點:
如可以看到的,該細胞是不對齊與標題。我如何讓他們對齊?