我有一个带有ItemsSource的DataGrid和带有绑定值的列。 出于某种原因,“全选按钮”最后加载,因此首先列标题向左对齐,并且在加载整个内容之后,出现“全选按钮”。我该如何修复那个眨眼? http://i.stack.imgur.com/EhesT.png
这是我的代码
<DataGrid.RowHeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type DataGridRow}},
Path=Item.RowHeader}"
HorizontalAlignment="Stretch"
MinWidth="55"/>
</DataTemplate>
</DataGrid.RowHeaderTemplate>
<DataGrid.Columns>
<!--m-->
<DataGridTextColumn Binding="{Binding Path=m, IsAsync=True, StringFormat='{}{0:0.##}'}" Header="m"/>
<!--α-->
<DataGridTextColumn Binding="{Binding Path=a, IsAsync=True}" Header="α" />
<!--h-->
<DataGridTextColumn Binding="{Binding Path=h, IsAsync=True, StringFormat='{}{0:0.#}'}" Header="h" />
<!--D1-->
<DataGridTextColumn Binding="{Binding Path=D1, IsAsync=True, StringFormat='{}{0:F0}'}">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<TextBlock>
D
<InlineUIContainer BaselineAlignment="Subscript">
<TextBlock Text="1"/>
</InlineUIContainer>
</TextBlock>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!--D2-->
<DataGridTextColumn Binding="{Binding Path=D2, IsAsync=True, StringFormat='{}{0:F0}'}">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<TextBlock>
D
<InlineUIContainer BaselineAlignment="Subscript">
<TextBlock Text="2"/>
</InlineUIContainer>
</TextBlock>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>