【问题标题】:DataGrid row tooltipDataGrid 行工具提示
【发布时间】:2014-12-10 03:14:39
【问题描述】:

我有以下 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>

有什么想法吗?

【问题讨论】:

    标签: wpf datagrid tooltip datagridrowheader


    【解决方案1】:

    这完全是我的错,没有注意到我有:

    <Setter Property="IsHitTestVisible" Value="False" />
    

    在我的 DataGridRow 样式中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-11-03
      • 2013-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-04
      • 2011-01-25
      • 1970-01-01
      相关资源
      最近更新 更多