Slow rendering of GridView with 60 elements x 3 checkboxes

1 Answer 182 Views
GridView
Martin
Top achievements
Rank 2
Iron
Iron
Iron
Martin asked on 11 Jul 2022, 10:59 AM | edited on 11 Jul 2022, 11:19 AM

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>


 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin
Top achievements
Rank 2
Iron
Iron
Iron
answered on 11 Jul 2022, 12:17 PM | edited on 11 Jul 2022, 12:18 PM

I've found the problem ...

I'm using MahApps to theme all the controls, and apparantly MahApps Metro takes a rather steep penalty on displaying even simple layouts like this...  

The difference is :

- No Metro Theme : 50 ms to display the control

- Metro Theme enabled : 470 ms !!

Tags
GridView
Asked by
Martin
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Martin
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or