RadGridView slow on 1st load

6 posts, 1 answers
  1. arto
    arto avatar
    12 posts
    Member since:
    Jun 2014

    Posted 09 Jun 2014 Link to this post

    Hello,

    I have a user control with 2 RadGridView controls on it, code bellow. This gets loaded on the main window with a button click.
    The problem I have is that there is a noticeable lag when this UserControl gets viewed on the screen 1st time. When the view changes and I go back to this view again then it's instantaneous so there is a perf degradation only at the 1st time viewing/loading it.

    The perf degradation is noticeable even when there is no bindings to RadGridView columns, or even with 1 RagGridView and 1 column in the control.
    I captured a perf report on VS viewing/loading this control multiple times, attached file perf.png, where you can clearly see the big CPU spike on the very first load but from there on it's not notifiable, the degradation seems to be coming from Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureCell.
        
    I've also looked at the troubleshooting documentation here but it didn't help.

    Can you please help with my xaml bellow to see if this degradation is somehow coming from the way I've nested the GridView or defined the sizes?

    I can send over a full project with a repro if needed.

    Thank you!


    <UserControl x:Class="SlowGrid.Views.UserControl1"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                 d:DesignHeight="610"
                 d:DesignWidth="1000"
                 mc:Ignorable="d">
        <Grid>
            <telerik:RadDocking Width="Auto"
                                Height="Auto"
                                HasDocumentHost="False">
                <telerik:RadSplitContainer InitialPosition="DockedTop" Orientation="Vertical">
                    <telerik:RadSplitContainer InitialPosition="DockedTop" telerik:ProportionalStackPanel.RelativeSize="250, 250">
                        <telerik:RadPaneGroup FontSize="13" telerik:StyleManager.Theme="Summer">
                            <telerik:RadPane CanUserClose="False" Header="a">
                                <telerik:RadGridView AutoGenerateColumns="False"
                                                     FontSize="14"
                                                     IsSynchronizedWithCurrentItem="True"
                                                     RowIndicatorVisibility="Collapsed"
                                                     ShowGroupPanel="False"
                                                     telerik:StyleManager.Theme="Summer">
                                    <telerik:RadGridView.Columns>
                                        <telerik:GridViewDataColumn Width="Auto" Header="a" />
                                        <telerik:GridViewDataColumn Width="*"
                                                                    Header="b"
                                                                    IsReadOnly="True" />
                                        <telerik:GridViewDataColumn Width="*"
                                                                    Header="c"
                                                                    IsReadOnly="True"
                                                                    TextAlignment="Center" />
                                        <telerik:GridViewDataColumn Width="*"
                                                                    Header="d"
                                                                    IsReadOnly="True"
                                                                    TextAlignment="Center" />
                                        <telerik:GridViewDataColumn Width="*"
                                                                    Header="e"
                                                                    IsReadOnly="True"
                                                                    TextAlignment="Center" />
                                        <telerik:GridViewDataColumn Width="*"
                                                                    Header="f"
                                                                    IsReadOnly="True"
                                                                    TextAlignment="Center" />
                                        <telerik:GridViewDataColumn Width="*"
                                                                    Header="g"
                                                                    IsReadOnly="True"
                                                                    TextAlignment="Center" />
                                        <telerik:GridViewDataColumn Width="*"
                                                                    Header="h"
                                                                    IsReadOnly="True"
                                                                    TextAlignment="Center" />
                                        <telerik:GridViewDataColumn Width="*"
                                                                    Header="i"
                                                                    IsReadOnly="True"
                                                                    TextAlignment="Center" />
                                    </telerik:RadGridView.Columns>
                                </telerik:RadGridView>
                            </telerik:RadPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                    <telerik:RadSplitContainer InitialPosition="DockedBottom" telerik:ProportionalStackPanel.RelativeSize="250, 750">
                        <telerik:RadPaneGroup FontSize="13" telerik:StyleManager.Theme="Summer">
                            <telerik:RadPane CanUserClose="False" Header="b">
                                <StackPanel Orientation="Vertical">
                                    <telerik:RadGridView AutoGenerateColumns="False"
                                                         FontSize="14"
                                                         IsReadOnly="True"
                                                         IsSynchronizedWithCurrentItem="True"
                                                         RowIndicatorVisibility="Collapsed"
                                                         ShowGroupPanel="False"
                                                         telerik:StyleManager.Theme="Summer">
                                        <telerik:RadGridView.Columns>
                                            <telerik:GridViewDataColumn Width="Auto" Header="a" />
                                            <telerik:GridViewDataColumn Width="*" Header="b" />
                                            <telerik:GridViewDataColumn Width="*"
                                                                        Header="c"
                                                                        TextAlignment="Center" />
                                            <telerik:GridViewDataColumn Width="*"
                                                                        Header="d"
                                                                        TextAlignment="Center" />
                                            <telerik:GridViewDataColumn Width="*"
                                                                        Header="e"
                                                                        TextAlignment="Center" />
                                            <telerik:GridViewDataColumn Width="*"
                                                                        Header="f"
                                                                        TextAlignment="Center" />
                                            <telerik:GridViewDataColumn Width="*"
                                                                        Header="g"
                                                                        TextAlignment="Center" />
                                            <telerik:GridViewDataColumn Width="*"
                                                                        Header="h"
                                                                        TextAlignment="Center" />
                                            <telerik:GridViewDataColumn Width="*"
                                                                        Header="i"
                                                                        TextAlignment="Center" />
                                            <telerik:GridViewDataColumn Width="*"
                                                                        Header="j"
                                                                        TextAlignment="Center" />
                                        </telerik:RadGridView.Columns>
                                    </telerik:RadGridView>
                                </StackPanel>
                            </telerik:RadPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                </telerik:RadSplitContainer>
            </telerik:RadDocking>
        </Grid>
    </UserControl>

  2. Yoan
    Admin
    Yoan avatar
    1197 posts

    Posted 12 Jun 2014 Link to this post

    Hello,

    Please ensure that RadGridView is not measured with Infinity as explained in the Degraded Performance help article. Please note that in case the UI Virtualization is disabled, then all the visual elements will be loaded once RadGridView is visualized and its items are populated. Otherwise only the visible items will be populated.

    As to the performance tips we can suggest - they are listed in the Tips and Tricks help article.

    However, if this does not help, could you try isolating the problem in a sample project and send it to us? We will debug it on our side and will assist you further.

    Regards,
    Yoan
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. arto
    arto avatar
    12 posts
    Member since:
    Jun 2014

    Posted 12 Jun 2014 in reply to Yoan Link to this post

    I have tried the links you've posted - without success.

    I do have a sample project - how can I send it over? Looks like this forum post only takes image extensions as attachments.
  4. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 13 Jun 2014 Link to this post

    Hi,

    The forum threads do not allow attaching zip files, only pictures.
    You can open a support ticket and attach it there.

    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  5. Andreas
    Andreas avatar
    4 posts
    Member since:
    Jul 2012

    Posted 09 Feb 2015 in reply to arto Link to this post

    Hello arto,

    I have the same problem with a very slow first load of a view with 3 RadGridViews. Did you solve your Problem?

    Thanks Andreas
  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 10 Feb 2015 Link to this post

    Hello Andreas,

    In case you still experience problems after applying the tips listed in the Tips and Tricks help article, may I ask you also check how fast is your data downloaded? You should also ensure the UI Virtualization is enabled.

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top