我有一个包含2个单选按钮和2个数据网格的网格。检查无线电按钮时,我将一个数据网格的可见性设置为可见,另一个设置为折叠。
我的数据网格只包含15行,但它真的很慢,当我的鼠标结束时,在实际看到悬停效果之前有一个很大的延迟。它在我的所有其他页面上都可以正常工作,但在这个页面上没有(它有很多其他组件)。
<Grid Name="conteneur2" Grid.Row="0" Margin="10,5">
<DataGrid EnableColumnVirtualization="True" EnableRowVirtualization="True" Style="{StaticResource StyleDataGrid}" ItemsSource="{Binding Path=_Data}" MaxWidth="2000" MaxHeight="1500" x:Name="dataGrid1" SelectionChanged="dataGrid1_SelectionChanged">
<DataGrid.Columns>
<DataGridTextColumn Header="Num" Width="40" Binding="{Binding Id}" IsReadOnly="True" />
<DataGridTextColumn Width="160*" MinWidth="160" Binding="{Binding Name}" IsReadOnly="True" />
<DataGridTextColumn Width="50" Binding="{Binding Stats.Value1}" IsReadOnly="True" />
<DataGridTextColumn Header="2pts" Width="55" Binding="{Binding Stats.Value2}" SortMemberPath="Stats.TirsReussis" IsReadOnly="True" />
<DataGridTextColumn Width="50" Binding="{Binding Stats.Value3}" IsReadOnly="True" />
<DataGridTextColumn Width="55" Binding="{Binding Stats.Value4}" IsReadOnly="True" />
<DataGridTextColumn Width="50" Binding="{Binding Stats.Value5}" IsReadOnly="True" />
<DataGridTextColumn Width="55" Binding="{Binding Stats.Value6}" IsReadOnly="True" />
<DataGridTextColumn Width="50" Binding="{Binding Stats.Value7}" IsReadOnly="True" />
<DataGridTextColumn Width="40" Binding="{Binding Stats.Value8}" IsReadOnly="True" />
<DataGridTextColumn Width="40" Binding="{Binding Stats.Value9}" IsReadOnly="True" />
<DataGridTextColumn Width="40" Binding="{Binding Stats.Value10}" IsReadOnly="True" />
<DataGridTextColumn Width="45" Binding="{Binding Stats.Value11}" IsReadOnly="True" />
<DataGridTextColumn Width="40" Binding="{Binding Stats.Value12}" IsReadOnly="True" />
<DataGridTextColumn Width="40" Binding="{Binding Stats.Value13}" IsReadOnly="True" />
<DataGridTextColumn Width="40" Binding="{Binding Stats.Value14}" IsReadOnly="True" />
<DataGridTextColumn Width="40" Binding="{Binding Stats.Value15}" IsReadOnly="True" />
<DataGridTextColumn Width="45" Binding="{Binding Stats.Value16}" IsReadOnly="True" />
<DataGridTextColumn Width="60" Binding="{Binding Stats.Value17}" SortMemberPath="Stats._Minute" IsReadOnly="True" />
</DataGrid.Columns>
</DataGrid>
</Grid>
为什么会这么慢?我该怎么做才能提高性能?
谢谢