DataGrid在触摸屏设备上缓慢

DataGrid在触摸屏设备上缓慢

本文介绍了WPF DataGrid在触摸屏设备上缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我一直在使用WPF DataGrid控件开发,有些情况下我自定义标题以包含一个文本框供用户过滤网格中的结果。



我注意到当我切换到启用了触摸屏的新笔记本电脑时,过滤非常慢,而且滚动浏览DataGrid是滞后的。 DataGrid有大约1,500行,有4列。



如果我通过设备管理器禁用我的触摸屏驱动程序,滚动执行速度更快,延迟非常小,并且过滤执行速度也快得多。



WPF和触摸屏设备是否存在任何已知问题?我不知道如何解决这个问题。



我认为这不是虚拟化问题。我已经启用了行虚拟化功能,它在我以前的笔记本电脑上运行效果很好,而不是触摸屏设备,我只是在切换到带触摸屏的新笔记本电脑时才意识到性能影响。



我已在此处上传了我的解决方案:  https://drive.google.com/file/d/0B22ToGClx-8fOVpUdnJBU1EyODA/view?usp = sharing

解决方案


I've been developing using the WPF DataGrid control, and there are cases where I customize the header to include a textbox for users to filter the results in the grid.

I noticed that when I switched to a new laptop with touch screen enabled, the filtering is very slow, and scrolling through the DataGrid is laggy. The DataGrid has around 1,500 rows with 4 columns.

If I disable my touch screen driver via Device Manager, the scrolling performs much faster with very minimal lag, and the filtering performs much faster too.

Is there any known issues with WPF and touch screen devices? I'm not sure how I should resolve this.

I do not think this is a virtualization problem. I've enabled row virtualization and it works great on my previous laptop which isn't a touch screen device, and I only realized the performance impact when switching to a new laptop with touch screen.

I've uploaded my solution here: https://drive.google.com/file/d/0B22ToGClx-8fOVpUdnJBU1EyODA/view?usp=sharing

解决方案


这篇关于WPF DataGrid在触摸屏设备上缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 21:54