Skip to content
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

Closed
tomshane opened this issue May 15, 2016 · 7 comments
Closed

DataGrid causes lag when switching content #2504

tomshane opened this issue May 15, 2016 · 7 comments
Assignees
Labels
Milestone

Comments

@tomshane
Copy link

tomshane commented May 15, 2016

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

  • MahApps.Metro v1.3.0-ALPHA150
  • Windows 10
  • Visual Studio 2015
  • .NET Framework 4.6
@punker76
Copy link
Member

@R74NN Thx for reporting this. Can you create a repo app for this issue, so we can try to find the problem. thx

@tomshane
Copy link
Author

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.

@punker76
Copy link
Member

@R74NN A demo would be very useful. Thx!

@tomshane
Copy link
Author

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.

@GAMP
Copy link

GAMP commented Jun 16, 2016

I think it can be blamed on DataGridCellHelper. In general it degrades performance and make datagrid lag behind from the native style.

@punker76
Copy link
Member

@R74NN @GAMP I'm looking for this

@punker76 punker76 added this to the 1.3.0 milestone Jun 16, 2016
@punker76 punker76 self-assigned this Jun 16, 2016
@punker76
Copy link
Member

punker76 commented Jul 5, 2016

@R74NN @GAMP You can test this PR for better performance #2570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants