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

Grid performance for around 2000 records

5 Answers 290 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kashi Reddy
Top achievements
Rank 1
Kashi Reddy asked on 02 Nov 2009, 11:42 AM
Hi all,

I am facing some performance issues and am a bit puzzled. I am sure I am missing something and would appreciate any suggestions.
I am using telerik WPF dlls with version 2009.2.0813.35.

The scenario is I am loading around 2000 objects. It takes almost 30 seconds to render. I assume by default it is using the virtualizing panel and looking at the profiler that seems to be the case. 

I am pasting the profiler output here. The problem seems to be the UpdateRowHeight call in the GridViewVirtualizingPanel where it seems to go through all the records even though the UI is virtualized.

61.08 % MeasureOverride - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.BaseVirtualizingPanel.MeasureOverride(Size)
  61.08 % UpdateRowHeight - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.UpdateRowHeight(IRowItem)
    61.08 % OnRefreshScrollExtent - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.OnRefreshScrollExtent()
      61.08 % RefreshItemsPhysicalHeightsCache - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.GridView.Scrolling.PhysicalHeightsCache.RefreshItemsPhysicalHeightsCache()
        61.08 % CreateDataRecordsHeightsCache - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.GridView.Scrolling.PhysicalHeightsCache.CreateDataRecordsHeightsCache(IList<Record>, Double, Int32, Int32)
          61.08 % InsertItem - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.GridView.Scrolling.RadKeyedCollection<TKey, TItem>.InsertItem(Int32, TItem)
            61.08 % AddKey - 18728 ms - 0 calls - Telerik.Windows.Controls.GridView.GridView.Scrolling.RadKeyedCollection<TKey, TItem>.AddKey(TKey, Int32)
              30.93 % System.Collections.Generic.Dictionary<TKey, TValue>.FindEntry... - 9484 ms - 0 calls
              30.15 % System.Collections.Generic.Dictionary<TKey, TValue>.Insert... - 9245 ms - 0 calls

-------------------------------------------------------------------------------------------------------------------------------

Is this a known thing or am I doing something wrong? The xaml fragment is below:

<telerik:RadGridView Name="OfficerGrid" AutoGenerateColumns="False" IsReadOnly="True"
                                 MultipleSelect="False" ShowGroupPanel="False"
                                 IsFilteringAllowed="False"
                                 SelectionChanged="OnSelectionChanged" DataLoadMode="Asynchronous"
                                 GridLinesVisibility="None"
                                 MouseDoubleClick="OfficerGrid_MouseDoubleClick">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Path=Name, Mode=OneWay}"/>
                    <telerik:GridViewDataColumn Header="Office" DataMemberBinding="{Binding Path=Office, Mode=OneWay}"/>
                    <telerik:GridViewDataColumn Header="Job Title" DataMemberBinding="{Binding Path=JobTitle, Mode=OneWay}"/>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>

Thanks for any help,
Kashi





5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 02 Nov 2009, 11:53 AM
Hi,

With our upcoming Q3 release (this week) you will not get such performance problems - you can check our latest Q3 beta demo with 1mil. records:
http://demos.telerik.com/wpf/beta/?GridView/Performance

You may check however if the grid is inside StackPanel or ScrollViewer in your scenario. If this is the case the performance  hit is expected since the grid will be measured with infinity height and will try to create all rows - no virtualization!

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
AT
Top achievements
Rank 1
answered on 25 Aug 2011, 01:05 AM
Hey guys,

Im facing the exact same problem as Kashi reported with latest version of Telerik WPF grid. The grid is taking around 90 seconds to render 2000 records with 7 columns.. In my case, the grid is not placed inside StackPanel or ScrollViewer.
Here is the XAML:
<telerik:RadGridView x:Name="SrResultsGridView"
                            AutomationProperties.AutomationId="SrResultsGridView"                           
                            CanUserFreezeColumns="False"
                            AutoGenerateColumns="False"
                            IsSynchronizedWithCurrentItem="True"
                            AutoExpandGroups = "True"
                            AllowDrop="False"
                            CanUserDeleteRows="False"
                            ActionOnLostFocus="None"
                            AreRowDetailsFrozen="True"
                            CanUserInsertRows="False"
                            ClipToBounds="True"
                            IsScrolling="False"
                            UseLayoutRounding="True"
                            SelectionMode="Extended"
                            ClipboardPasteMode="Default"
                            IsReadOnly="True"
                            IsFilteringAllowed="False"
                            VirtualizingStackPanel.VirtualizationMode="Standard"                           
                            Height="Auto"
                            Focusable="False"
                            >
            </telerik:RadGridView>

Is this a known issue? let me know if you need additional details.
0
Pavel Pavlov
Telerik team
answered on 25 Aug 2011, 01:28 PM
Hi Akash Trivedi,

It is absolutely not expected to take 90 seconds to load data. Any details on how we can reproduce the problem here would be highly  appreciated.

Regards,
Pavel Pavlov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Ben Boger
Top achievements
Rank 1
answered on 06 Oct 2011, 09:50 PM
this is a bit of an old post but I am curious if this would also be measured as infinity if you were to put it in a grid with a rowdefinition height="Auto" or height="*"
0
Vlad
Telerik team
answered on 07 Oct 2011, 06:37 AM
Hi,

 Grid.Row with Height set to Auto will measure with infinity height. 

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Kashi Reddy
Top achievements
Rank 1
Answers by
Vlad
Telerik team
AT
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Ben Boger
Top achievements
Rank 1
Share this question
or