MahApps / MahApps.Metro

A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
https://mahapps.com
MIT License
9.32k stars 2.45k forks source link

Slow loading DataGrid with Editable Fields #4286

Open slanbr opened 2 years ago

slanbr commented 2 years ago

I'm using Datagrid with editable fields and in some cases a datagrid inside another, when I use this way my datagrid is getting very slow when I have several lines. Is there any way to improve performance or is this bad practice?

timunie commented 2 years ago

Hi @slanbr ,

Placing a DataGrid inside another will break virtualization which leads to the performance impact you noticed. This is not MahApps specific, its how WPF works. I highly recommend to try a different approach, also from the UI experience it may not be the best solution.

Happy coding Tim

slanbr commented 2 years ago

Hello @timunie ,

Using the option to make the grid editable by expanding the line also causes the same problem of slowness, is this also referring to virtualization?

timunie commented 2 years ago

Possible. Maybe try to limit the size of the nested DataGrid.