WPF网格上一个/旧的工具提示问题 [英] WPF Grid previous/old Tool tips issue

查看:56
本文介绍了WPF网格上一个/旧的工具提示问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我们正面临着WPF网格工具提示的问题。当我们在网格上执行排序和过滤时,它会显示旧行工具提示而不是当前行。经过大量的谷歌搜索没有找到任何有效的解决方案。 
$


参考视频#https://www.screencast.com/t/dljwS6yjji7U。



以下代码用于将工具提示实施到网格中。



 < core:Tv10NonBoundGrid x:Name =" ; SearchGrid" RTL:TPanel.Align = QUOT;客户"的TabIndex = QUOT; 12英寸只读= QUOT;真" BorderBrush = QUOT;#a0a0a0"余量= QUOT; 10,220,10,10" onfocus此= QUOT; DoGridDblClick" ScrollViewer.ScrollChanged =" searchGrid_ScrollChanged">

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < core:Tv10NonBoundGrid.Resources>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Style TargetType =" {x:Type core:TcxGridDataCell}">

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Setter Property =" ToolTip" Value =" {Binding RelativeSource = {RelativeSource Self},Converter = {StaticResource GlobalSearchToolTipConverter}}" />

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / Style>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Style TargetType =" {x:Type ToolTip}">

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Style.Triggers>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Trigger Property =" Content"值=" {x:Null}">

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Setter Property =" Visibility" Value =" Collapsed" />

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / Trigger>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < /Style.Triggers>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / Style>



$
我们使用自己的框架,因此很难共享代码。



我们使用平滑(逐像素/物理)滚动来实现慢速分页,如: -
  CanContentScroll = false;

  IsDeferredScrollingEnabled = true;

我们还使用注释代码进行了测试,但问题仍然存在。我还隐藏了网格的可视化,然后没有解决问题。



Hi,

We are facing issue with WPF grid tooltips. when we are performing sorting and filtering on the grid then it displays old row tooltips instead off current rows. after did lots of googling not found any fruitful solution. 

Reference video# https://www.screencast.com/t/dljwS6yjji7U .

Following code used to implement tooltips into the grid.

 <core:Tv10NonBoundGrid x:Name="SearchGrid" rtl:TPanel.Align="Client" TabIndex="12" ReadOnly="True" BorderBrush="#a0a0a0" Margin="10,220,10,10" OnDblClick="DoGridDblClick" ScrollViewer.ScrollChanged="searchGrid_ScrollChanged">
            <core:Tv10NonBoundGrid.Resources>
                <Style TargetType="{x:Type core:TcxGridDataCell}">
                    <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Converter={StaticResource GlobalSearchToolTipConverter}}"/>
                </Style>
                <Style TargetType="{x:Type ToolTip}">
                    <Style.Triggers>
                        <Trigger Property="Content" Value="{x:Null}">
                            <Setter Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>


We are using our own framework, so it tough to share code.

We are using Smooth (pixel-by-pixel/physical) scrolling to achieve slow paging like:-
 CanContentScroll = false;
 IsDeferredScrollingEnabled = true;
We also tested with commented code but the problem is still there. I also hide visualization of the grid then not resolve the issue.


谢谢,Kapil Khare

Thanks, Kapil Khare

推荐答案

使用您显示的代码我认为问题是绑定到RelativeSource Self意味着更新只会在"自我"时发生。 。变化&NBSP;当您的DataGrid(而非Grid)中的行发生更改时,您的Converter会被调用。 如果
不是那么你的绑定是不正确的。
Using the code you showed I think the problem is that binding to RelativeSource Self means that updates will only take place when the "Self" changes.  When a row in your DataGrid (not Grid) changes does your Converter get called.  If not then your binding is incorrect.


这篇关于WPF网格上一个/旧的工具提示问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆