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

WPF Gridview using Group - performance slow

20 Answers 660 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Johnson
Top achievements
Rank 1
Johnson asked on 24 Apr 2012, 05:06 PM
Hi,

I am in the process of evaluating Telerik Gridview.  Our data is organized in groups.  I created a RadGridView that uses 1 column as a GroupDescriptor.  I noticed that the scrolling through each grouped table is VERY slow as each group is expanded (AutoExpandGroups="True").  The performance is better if I remove GroupDescriptor altogether.  Here are what I set in my RadGridView:

<code>CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed"  AutoGenerateColumns="False" IsReadOnly="True" ScrollMode="Deferred"   telerik:StyleManager.Theme="Metro" FontSize="11" ShowGroupPanel="False" RowHeight="18" Grid.Row="1"  Width="1320" MaxWidth="1320" MinHeight="800" MaxHeight="1000"</code>


Is there anything I can do to increase the performance.  The table size is around 14000 cells.  

I saw this earlier post and it was stated that the issue was resolved. I can't download the code as I am not yet a licensed user.
http://www.telerik.com/support/pits.aspx#/public/winforms/4570 

Please advise.  Thanks.

20 Answers, 1 is accepted

Sort by
0
Yordanka
Telerik team
answered on 25 Apr 2012, 07:50 AM
Hello Johnson,

Is the question related to RadGridView for WPF or to RadGridView for WinForms? The mentioned PITS item is for RadGridView for WinForms.
 
Greetings,
Yordanka
the Telerik team

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

0
Johnson
Top achievements
Rank 1
answered on 25 Apr 2012, 01:22 PM
My question is actually related to WPF, not Winforms.  Can you please advise?  Thanks.
0
Vlad
Telerik team
answered on 25 Apr 2012, 01:23 PM
Hi,

 The issue you've posted is related to the Winforms grid. 

All the best,
Vlad
the Telerik team

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

0
Johnson
Top achievements
Rank 1
answered on 25 Apr 2012, 01:26 PM
Yes, I see that the original PIT is related to Winforms (my mistake).   However in my evaluation I am using WPF Telerik RadGridview component with grouping.  The performance becomes slows with grouping.  Can you advise as how to optimize my code to avoid this?  Thanks.
0
Yordanka
Telerik team
answered on 26 Apr 2012, 10:07 AM
Hello Johnson,

Can you send us a sample project close to your scenario? We will check what is going on and will provide with further assistance.
In order to attach a project you need to open a separate support ticket.
 
Kind regards,
Yordanka
the Telerik team

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

0
Johnson
Top achievements
Rank 1
answered on 26 Apr 2012, 10:20 PM
Hi,

I can't see where I can submit a support team as I am not yet a licensed user (we are evaluating).
Please advise.

1 thing I tried today is that I loaded the data from our database into telerik demo project ->

Telerik.Windows.Examples.GridView.DataSources.MyModel

In GetData() method's GetDataTable() method, I return the data from our database instead of using the demo data.
I see that the performance is slowing when I added grouping column.

My code is basically modeling after the demo project.  It loaded the data from database into DataTable and load it into RadGridview.
Our data is basically 197 columns x 115 rows in size.
0
Johnson
Top achievements
Rank 1
answered on 17 May 2012, 06:02 PM
It seems that the rendering of the data to Gridview UI is slow.  
After I made the call -> GridView.ItemSource = <my data table>, the code was executed but UI does not show the data immediately.  There's a lag.  I think my question is how should I structure my code such that the speed at which Gridview UI rendering can improve?  

0
Johnson
Top achievements
Rank 1
answered on 21 May 2012, 06:56 PM
Can you advise?  I've been trying to figure out why the slowness occurred without any luck.
More info on my Gridview setup:

1) EnableColumnVirtualization and EnableRowVirtualization are set to TRUE as by default
2) DataLoadMode="Asynchronous"
3) After the data is loaded, I added data filtering in my C# code
4) The column has fixed size and not resizable and the data type is not complex. I only added DayaFormatString for formatting purpose

Gridview in XAML:

<telerik:RadGridView  Name="MyTable" HorizontalAlignment="Left"  VerticalAlignment="Top" AutoExpandGroups="True"  DataLoadMode="Asynchronous"   CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed"   AutoGenerateColumns="False" IsReadOnly="True" ScrollMode="Deferred" EnableColumnVirtualization="True" EnableRowVirtualization="True"  telerik:StyleManager.Theme="Metro" FontSize="11" ShowGroupPanel="False" RowHeight="18"  Width="1500" MaxWidth="1600" Height="860" MaxHeight="1000"
CanUserResizeColumns="False" CanUserReorderColumns="False" CanUserInsertRows="False" CanUserDeleteRows="False" CanUserSortColumns="False">
0
Vlad
Telerik team
answered on 22 May 2012, 07:38 AM
Hi,

 Please send us support ticket with sample project where we can replicate this slowness. Once we have more info we will let you know what's going on in your case!

Greetings,
Vlad
the Telerik team

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

0
Johnson
Top achievements
Rank 1
answered on 22 May 2012, 05:36 PM
0
Yordanka
Telerik team
answered on 23 May 2012, 12:13 PM
Hi Johnson,

Thank you for the project.

In your scenario, the grid loads more than 40 items and 30 columns. This means that many visual elements are created on initial load which is time consuming operation. You can try setting RowHeight="25" which is the default value and will notice the grid rendering will be twice faster.
 
Regards,
Yordanka
the Telerik team

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

0
Johnson
Top achievements
Rank 1
answered on 23 May 2012, 06:24 PM
I do notice a better performance once I removed RowHeight="18".  However, it's still not as quick as expected.
Is there anything else i can tune to make it faster? 

Thanks.
0
Johnson
Top achievements
Rank 1
answered on 23 May 2012, 08:13 PM
Also I noticed that the performance suffers when you have a gridview under a RadTabItem that is under a RadDocumentPane in a RadDocking.  Why is that?
0
Pavel Pavlov
Telerik team
answered on 24 May 2012, 01:38 PM
Hi Johnson Ho,

On your latest observation - in such setup it is possible for RadGridView to be measured with height of infinity. This will prevent it form using virtualization thus the reduced performance. This can be easily diagnosed by testing RadGridView with explicitly limited height.

Regards,
Pavel Pavlov
the Telerik team

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

0
Johnson
Top achievements
Rank 1
answered on 24 May 2012, 02:09 PM
As you can see in the sample project I posted - 
http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=546810  

I did set the Height and Width for the Gridview:

<telerik:RadGridView  Name="MyGridView" HorizontalAlignment="Left"  VerticalAlignment="Top" DataLoadMode="Asynchronous"   Grid.Row="1" Grid.Column="0"  
                           CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed"   AutoGenerateColumns="False" IsReadOnly="True" ScrollMode="Deferred"
                           ShowGroupPanel="False"  Width="1500" MaxWidth="1600" Height="860" MaxHeight="1000" BorderBrush="#FF2E398A"
                           CanUserResizeColumns="False" CanUserReorderColumns="False" CanUserInsertRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"  ItemsSource="{Binding Data, Source={StaticResource model}}">

Do I need to set Height and Width for RadTabControl?  I did but it's not making any difference:

<telerik:RadTabControl Name="MainTabContainer" Height="1600" Width="1400">


Please advise.  Thanks!
0
Johnson
Top achievements
Rank 1
answered on 24 May 2012, 10:49 PM
Since we're in the process of evaulating both Telerik and Dev Express, given the same sample project, we also used DevExpress's GridControl for the same SampleData.xml.  Dev Express's GridControl seems to render the data faster.  We notice that when we group the data and then expand each group.  There's a delay in RadGridView.  I must be doing something wrong.  Please advise. Thanks.
0
Accepted
Yordanka
Telerik team
answered on 29 May 2012, 02:05 PM
Hello Johnson,

You can try setting IsContentPreserved property of RadTabControl to True. In this way, the content will be preserved and next time the tab item is selected the rendering will be much faster.

As to the problem with expand groups - I was not able to reproduce it using the project attached in the other thread. Can you provide more details or steps to reproduce it?

All the best,
Yordanka
the Telerik team

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

0
Johnson
Top achievements
Rank 1
answered on 30 May 2012, 05:12 AM
Just drop Col23 to the group panel and then try to expand TX group and you will notice the slowness in rendering.

Setting "IsContentPreserved" property seems to speed up a bit but it's not huge though.
0
Accepted
Yordanka
Telerik team
answered on 30 May 2012, 08:52 AM
Hi Johnson,

I've just noticed that the grid is defined in a row and a column with dynamic Height and Width:

<Grid Name="PoolListGrid" VerticalAlignment="Top" HorizontalAlignment="Left" MaxWidth="1600" Width="1500">
       <Grid.RowDefinitions>
           <RowDefinition Height="45" />
           <RowDefinition Height="120*" />
       </Grid.RowDefinitions>
       <Grid.ColumnDefinitions>
           <ColumnDefinition Width="200*" />
       </Grid.ColumnDefinitions>
           <telerik:RadGridView  Name="MyGridView" HorizontalAlignment="Left"  VerticalAlignment="Top" Grid.Row="1" Grid.Column="0" ...

Setting Height and Width to Star or fixed size will improve the performance.

Let me know if you have additional questions.
 
Kind regards,
Yordanka
the Telerik team

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

0
Johnson
Top achievements
Rank 1
answered on 05 Jun 2012, 01:27 PM
Hi,

That helps. Thanks.  However we still don't see the same performance that we would see in DevExpress.
What other things can I tune & adjust?  We appreciate your help!

Thanks again.
Tags
GridView
Asked by
Johnson
Top achievements
Rank 1
Answers by
Yordanka
Telerik team
Johnson
Top achievements
Rank 1
Vlad
Telerik team
Pavel Pavlov
Telerik team
Share this question
or