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

Performance Improvement in RadGridView

7 Answers 460 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nishan
Top achievements
Rank 1
Nishan asked on 27 Jan 2011, 10:37 AM
Hi
I am binding 800000 records to the radgridvew control and one way of doing is as follows as normally.

List<Company> companyList = new List<Company>();
for (int i = 0; i < 800000; i++)
{
    companyList.Add(
        new Company()
        {
            Id = i,
            Name = "test name " + i,
            Address = "test address " + i,
            Revenue = 88888888,
            BusinessAres = "test area " + i,
        });
}
radGridView1.ItemsSource = companyList;

So with Q3 I try to optimize the performance like below.

List<Company> companyList = new List<Company>();
for (int i = 0; i < 800000; i++)
{
    companyList.Add(
        new Company()
        {
            Id = i,
            Name = "test name " + i,
            Address = "test address " + i,
            Revenue = 88888888,
            BusinessAres = "test area " + i,
        });
}
 
var viewList = new VirtualQueryableCollectionView(companyList) { LoadSize = 10 };           
radGridView1.DataContext= viewList;

my xaml code is like this

<Window x:Class="WpfApplication1.MainWindow"
        Title="MainWindow" Height="350" Width="525" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Loaded="Window_Loaded">
    <Grid>
        <telerik:RadGridView HorizontalAlignment="Stretch"
                             Margin="0,43,0,0"
                             Name="radGridView1"
                             ItemsSource="{Binding}"
                              
                             VerticalAlignment="Stretch" />
        <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="23,12,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
    </Grid>
</Window>

this increases the rendering speed little but I am still looking something better. So if anyone can suggest a way please reply. Thanks in advance.

Nishan
 

7 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 27 Jan 2011, 12:59 PM
Hello Nishan,

Could you please elaborate on the performance problems that you are currently facing? Are you bothered by a slow initial load time, slow vertical or horizontal scrolling?


Greetings,
Milan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Nishan
Top achievements
Rank 1
answered on 28 Jan 2011, 04:14 AM
Thank you very much for the quick response. Actually I am bothered by the slow initial load time. It takes about 1-2 seconds to load the data but I want to make it super fast. Also I don't want paging. Thanks.
0
Milan
Telerik team
answered on 28 Jan 2011, 04:27 PM

Hi Nishan,

Have you tried to generate the data before you actually assign it as ItemsSource. Data generation for 800000 item takes some time and it might be causing the slowdown. You can try generating the data in the constructor of your page and to assign the ItemsSource of button click. 

Could you please try that and tell me if you see and improvement.



All the best,
Milan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Sam Ur
Top achievements
Rank 2
answered on 17 Feb 2011, 09:35 AM
Actually I'm having the same issue, I followed the ORM - WPF quickstart guide and even in that sample gride takes a sec. or two to load, so when I'm using a model that populates more data wpf grid really takes a few sec (1-3) to load. I tried to populate data in constructor before I load them but the result (time wise) was the same.

EDIT:
 When I'm using RadGridView in tab control it also works very slow - because i guess it re-renders everytime i change tab.

P.S.
I made a console app. just to see if getting data takes so long - but it doesn't.
0
Milan
Telerik team
answered on 17 Feb 2011, 11:39 AM

Hi Sam Ur,

Could you please take a look at this help topic which contains some tips that might help you improve performance. 



Regards,
Milan
the Telerik team
0
Sam Ur
Top achievements
Rank 2
answered on 17 Feb 2011, 01:35 PM
Thank you I'll look into it.
0
Sam Ur
Top achievements
Rank 2
answered on 18 Feb 2011, 01:48 PM
Best thing i found to improve performance was the use of RadDataPager - now performance is not pefect but still much better.
Slight issue i had was still when RadGridView is used in RadTabItem - everytime that item looses focus and regains it - data gets re-loaded, that downgraded performance a bit - if you don't use the necessary steps to avoid this issue.

Milan thnx again 4 the advice where to look performance tricks.
Tags
GridView
Asked by
Nishan
Top achievements
Rank 1
Answers by
Milan
Telerik team
Nishan
Top achievements
Rank 1
Sam Ur
Top achievements
Rank 2
Share this question
or