我正在使用 VS 2010。我只想在网格鼠标悬停时显示 Datagrid 标题。我写了以下代码,但它不起作用。
<StackPanel>
<DataGrid ItemsSource="{Binding SelectedItemsCollectionView}"
AutoGenerateColumns="False" CellStyle="{StaticResource CellStyle}"
GridLinesVisibility="None" RowHeight="28" HeadersVisibility="None"
ClipToBounds="True" AllowDrop="True" >
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Path=DisplaySequence}"/>
</DataGrid.Columns>
<DataGrid.Style>
<Style TargetType="DataGrid">
<Setter Property="HeadersVisibility" Value="None" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="HeadersVisibility" Value="Column" />
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.Style>
</DataGrid>
</StackPanel>
有什么建议么?
谢谢!