I'm investigating why / how to improve the rendering speed of a rather complex UserControl / Window
The Window contains a Tab-Control where one of these tabs contain a GridView which is very basic on its own.
Each of the ~60 rows are bound to an object which has a String + 3x bool properties.
Each time the Window is opene, the list is reset.
The list of elements is kept in an ObservableCollection (which isn't necessary since the list never change.. but what the heck)
Here's the thing - when Profiling, this Gridview spends 600 msec !! in the Layout phase on the UI Thread... 600 msec !
Is there anything i can do about it ?
(To be honest - the standard WPF ListView spends 2200 msec rendering this list !!!)
I'm aware of https://docs.telerik.com/devtools/wpf/controls/radgridview/performance/tips-tricks
- The container has a fixed size
- Each column has a fixed width
- Row Virtualization is enabled
- Scrollbars har hardcoded to be enabled/disabled in advance.
- Removing the CellTemplates didn't make a difference - time is still ~600msec
- The last thing i havent tried is using the lightweight styling, but i have some bad experiences with those.
<telerik:RadGridView x:Name="lvCompanyFabrikater"
telerik:StyleManager.Theme="Fluent"
AutoGenerateColumns="False"
Background="{DynamicResource MahApps.Brushes.ThemeBackground}"
CanUserFreezeColumns="False"
CanUserSearch="False"
CanUserSearchInHiddenColumns="False"
EnableRowVirtualization="True"
GridLinesVisibility="None"
GroupRenderMode="Flat"
IsFilteringAllowed="True"
IsPropertyChangedAggregationEnabled="False"
IsReadOnly="True"
RowIndicatorVisibility="Collapsed"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Visible"
SelectionMode="Single"
ShowGroupPanel="False">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Width="100"
DataMemberBinding="{Binding FabrikatNavn}"
Header="Fabrikat" />
<telerik:GridViewDataColumn Width="50" Header="Salg">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Salg}" />
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Width="60" Header="Service">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Service}" />
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Width="85" Header="Reservedele">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Reservedele}" />
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>