dotnet / DataGridExtensions

Modular extensions for the WPF DataGrid control
MIT License
811 stars 103 forks source link

OnApplyTemplate when switching tabs #73

Closed sparedevone closed 2 years ago

sparedevone commented 2 years ago

It will be good to improve current behavior of header template creation. In case of switching tabs in DataGridExtensionsSample always calls OnApplyTemplate when a custom filter column was assign, e.g. dgx:DataGridFilterColumn.Template="{StaticResource MultipleChoiceFilter}"

In case a few rows in DataGrid it will not notice, but in a scenario of more then 1000 rows and a defined filter criteria OnApplyTemplate will be called for each custom filter column and this triggers CreatePredicate finally.

This delays switching tabs unusually long, even though no filter criteria was changed.

2021-11-01_19-05-28

tom-englert commented 2 years ago

@sparedevone That's a general WPF issue, what do you think DGX could do about this?

sparedevone commented 2 years ago

Currently I'm not able to provide an alternative approach. DGX should be loaded the templates only one time or still remember that it was done before in order to just load the dataset only when filter the criteria was change. Or there is another way to place the FilterControl.

tom-englert commented 2 years ago

I don't think this is something that could be solved by DGX - you would need to write another TabControl that does not reload the content when changing tabs.