-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataGrid causes lag when switching content #2504
Comments
@R74NN Thx for reporting this. Can you create a repo app for this issue, so we can try to find the problem. thx |
One another thing I have noticed. I have 1000 items in the grid and when I run the application with default window size of something like 1024x720, the grid scrolls quite fine and smoothly. When I maximize and restore the window few times, the grid scrolling becomes jerky and the grid exhibits very high CPU usage. And again, without MahApps styles the behaviour is without these problems. Unfortunately I can't send you my current project where the issue is present, however I hope I will be able to prepare a demo over the weekend. Thanks. |
@R74NN A demo would be very useful. Thx! |
Hi, sorry for the delay. Here is the app demonstrating the issue. When you run it, the DataGrid scrolls nicely and smoothly. If you maximize the window and then restore to original size again, the scrolling is more jerky and takes more processor power. It is more noticeable when running from Visual Studio. If you run the exe alone, the problem is not that significant, but still there. https://www.dropbox.com/s/l8czkfnk58j2six/WpfApplication1.zip?dl=0 Thanks. |
I think it can be blamed on DataGridCellHelper. In general it degrades performance and make datagrid lag behind from the native style. |
@R74NN @GAMP I'm looking for this |
What steps will reproduce this issue?
I'm using basic WPF DataGrid with MahApps styles. When switching content in ContentControl the page containing the DataGrid causes noticeable lag when switching from it.
The lag is not present on an empty grid. But when it contains some rows (tested on 100 rows and 10 columns) the lag appears. When I disable MahApps and all other code stays in place, the lag is not present and the switching is instant.
I'm not sure but a clue could be DataGridCellHelper and DataGridCellUnloaded event.
Environment
The text was updated successfully, but these errors were encountered: