This is a migrated thread and some comments may be shown as answers.

RadGrid performance issues

1 Answer 186 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 17 Oct 2018, 03:31 PM

I am making a test app to measure the loading speed of Windows DataGrid vs RadGrid. In the app I was binding Data Tables and Collections into DataGrid and RadGrid. Binding to the Windows DataGrid I would see and average time of 5ms for DataTables and 1.5ms for Collections. When you bind to RadGrid I get 200-400ms regardless of the type. Any ideas?

<telerik:RadBusyIndicator IsBusy="{Binding Path=IsBusy}">
        <Grid DataContext="{Binding Telerik, Source={StaticResource Locator}}">

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.Resources>
                <Style TargetType="DataGrid">
                    <Setter Property="HorizontalAlignment" Value="Stretch"/>
                    <Setter Property="VerticalAlignment" Value="Stretch"/>
                    <Setter Property="Margin" Value="10"/>
                </Style>
                <Style TargetType="Button">
                    <Setter Property="Width" Value="75"/>
                    <Setter Property="HorizontalAlignment" Value="Center"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                    <Setter Property="Margin" Value="10"/>
                </Style>
                <Style TargetType="TextBlock">
                    <Setter Property="Width" Value="75"/>
                    <Setter Property="HorizontalAlignment" Value="Center"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                    <Setter Property="Margin" Value="10"/>
                </Style>
                <Style x:Key="TextLabel" TargetType="TextBlock">
                    <Setter Property="HorizontalAlignment" Value="Right"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                    <Setter Property="Margin" Value="2"/>
                    <Setter Property="FontWeight" Value="Bold"/>
                </Style>
                <Style x:Key="ToolBarImage" TargetType="Image">
                    <Setter Property="Width" Value="20"/>
                    <Setter Property="Height" Value="20"/>
                    <Setter Property="Margin" Value="1"/>
                </Style>
            </Grid.Resources>
            <ToolBarTray>
                <ToolBar>
                    <Button Command="{Binding ExitCommand}"  ToolTip="Home">
                        <Grid>
                            <Image Source="{StaticResource Home}" Style="{StaticResource ResourceKey=ToolBarImage}"/>
                        </Grid>
                    </Button>
                    <Button Command="{Binding DataCommand}"  ToolTip="Execute" >
                        <Grid>
                            <Image Source="{StaticResource Play}" Style="{StaticResource ResourceKey=ToolBarImage}"/>
                        </Grid>
                    </Button>
                    <Button Command="{Binding ResetCommand}"  ToolTip="Reset">
                        <Grid>
                            <Image Source="{StaticResource Reset}" Style="{StaticResource ResourceKey=ToolBarImage}"/>
                        </Grid>
                    </Button>
                    <Separator/>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Execution Time:" Style="{StaticResource TextLabel}"/>
                        <TextBlock Text="{Binding TimeElapsed, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, StringFormat={}{0:F3} ms}"/>
                    </StackPanel>
                    <Separator/>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Average Time:" Style="{StaticResource TextLabel}"/>
                        <TextBlock Text="{Binding AvgTimeElapsed, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, StringFormat={}{0:F3} ms}"/>
                    </StackPanel>
                    <Separator/>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Times executed: " Style="{StaticResource TextLabel}"/>
                        <TextBlock Text="{Binding ExecutedNum, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
                    </StackPanel>
                </ToolBar>
            </ToolBarTray>
            <telerik:RadGridView Grid.Row="1" Grid.Column="0" ItemsSource="{Binding MoldData}" Name="dataGridView1"/>
            
        </Grid>
    </telerik:RadBusyIndicator>

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 19 Oct 2018, 10:44 AM
Hello Jonathan,

I will paste my reply from the support ticket you opened here as well so that it is beneficial to the community.

"This overhead in the loading time of the RadGridView is caused by the rendering of all its elements - their control templates are a bit more complex than those of the standard MS DataGrid.

With this said, the Telerik UI for WPF suite provides several additional styles with simplified templates, which you can merge in your project. The main idea of the lightweight templates is to limit the number of visual elements within the templates in order to speed up the performance of the control.

Could you please give them a try and let me know if they speed up the load time of your application? I look forward to your reply."

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or