-
Notifications
You must be signed in to change notification settings - Fork 1.2k
When Popup (combobox, tooltip, menu item, etc) is shown within an app with a DataGrid, the DataGrid becomes slow and less responsive. #9881
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
Comments
@h3xds1nz Thanks for pointing this out. Do you know if Microsoft is addressing this? |
It appears I was able to solve my data grid sluggish issue by making my own DataGrid class and returning null in OnCreateAutomationPeer. I'm not sure what ramifications this may have but it appears to work,.
|
I found a solution that works for my problem. I had to override the Windows class. From there you override the OnCreateAutomationPeer() method.
In your custom Window class add
|
I am also experiencing this issue. Specifically having a PopUp on the screen greatly hurts the performance of my datagrid with roughly 900-1200 rows and maybe 40 columns. It runs well until the PopUp first appears. |
I encountered the same issue with ListView: the initial response is fast, but after any control pops up, the response delay increases sharply and becomes irreversible. Even after running for a long time, it does not recover. Referring to the above, overriding the OnCreateAutomationPeer method can solve this problem. I don’t know why such a performance issue occurs, nor do I understand whether overriding this method might lead to new problems. |
Description
When Popup (combobox, tooltip, menu item, etc) is shown within an app with a DataGrid, the DataGrid becomes slow and less responsive. When debugging this problem, we output properties from before and after the popup was shown. It appears the datagrid has several properties that get changed when only a popup is shown. Properties of interest include SizeToContentV, HasStarCellsU, HasGroup3CellsInAutoRows.
I ran a performance profiler and can see that after the popup is shown the Layout time increases by a major factor as well as the frame rate drops substantially.
I have tried to fix the datagrid column width and row height to no avail. I have also overridden the cell template with fixed size values and this did not work either.
DataGridTest.zip
Reproduction Steps
Apps with more complex UIs will display this issue more apparently.
Included app has a button Export that will export all properties of the app. You can export before following the steps above. Then export again once slowness occurs and you will see properties are changed from before and after combobox items are displayed. Please see screen shot from Description for comparison.
Expected behavior
Datagrid should behave the same way before a Popup (combobox, tooltip, menu item, etc) is shown and after.
Actual behavior
Datagrid is responsive before a Popup (combobox, tooltip, menu item, etc) is shown. After the popup is shown, datagrid slows.
Regression?
Problem exists in NET6 and NET8
Known Workarounds
None at this time
Impact
Datagrid in the app becomes slow and sluggish to use. Our app is a real-time app that requires the datagrid to be responsive to user input.
Configuration
Windows 11 Pro 23H2 OS Build 22631.4169
Visual Studio 2022 Version 17.9.6
x64
Other information
No response
The text was updated successfully, but these errors were encountered: