我有以下DataGrid,由于某些原因,我在行上创建的工具提示没有显示我在该行上停留:
<DataGrid
Name="dataGrid"
CanUserAddRows="False"
CanUserDeleteRows="False"
CanUserReorderColumns="False"
GridLinesVisibility="None"
ItemsSource="{Binding PermissionsCollection,UpdateSourceTrigger=PropertyChanged}"
AlternatingRowBackground="{StaticResource VigilantDataGridAlternatingRowColor}"
ColumnHeaderStyle="{StaticResource VigilantDataGridColumnHeader}"
RowHeaderWidth="0"
RowHeight="30"
AutoGenerateColumns="False"
SelectionMode="Single"
Height="536"
Width="700"
IsTextSearchEnabled="True"
ToolTipService.ShowOnDisabled="True">
<DataGrid.Resources>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<EventSetter Event="MouseDown" Handler="MouseDownHandler"/>
</Style>
<Style TargetType="{x:Type DataGridRow}">
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
<Setter Property="ToolTip">
<Setter.Value>
<TextBlock Text="1234"/>
</Setter.Value>
</Setter>
<Setter Property="IsHitTestVisible" Value="False" />
</Style>
</DataGrid.Resources>
任何想法?
答案 0 :(得分:1)
这完全是我的坏事,没有注意到我曾经:
<Setter Property="IsHitTestVisible" Value="False" />
以我的DataGridRow样式。