radgridview slow databinding

18 posts, 1 answers
  1. joao rodrigues
    joao rodrigues avatar
    20 posts
    Member since:
    Mar 2010

    Posted 28 Apr 2010 Link to this post

    Hi,

    I'm evaluating silverlight controls comparing telerik and others and my major concern has to be with the gridview component since in Bussiness Apps is a fundamental component.

    I'm using the radgridview in three screnarios for loading 2000 recs x 15 cols using RIA services :
    1 - xaml only :

     

     

     

    <my1:RadGridView Name="rgv1" AutoExpandGroups="True" ItemsSource="{Binding Data, ElementName=dataDomainDataSource}" />

     


    2- xaml + Code (bind after load)

    <my1:RadGridView Name="RadGrid1" AutoExpandGroups="True"/>

    +

    CFDomainContext ctx = new CFDomainContext();

     

    ctx.Load(ctx.GetVEntitiesQuery());

    +

     

     

    private void Button_Click_3(object sender, System.Windows.RoutedEventArgs e)

     

    {

    RadGrid1.ItemsSource = ctx.VEntities;

    }


    3 - xaml + Code (databind):

    <

     

     

    my1:RadGridView Name="RadGrid1" AutoExpandGroups="True"

     

     

     

    ItemsSource="{Binding Path=VEntities}"/>

     

    +

     

     

    CFDomainContext ctx = new CFDomainContext();

     

    this

     

     

    .DataContext = ctx;

     

    ctx.Load(ctx.GetVEntitiesQuery());

     

     

    The first scenario takes about 4 secs, what is good.

    The second scenario takes about 2 seconds to perform the load (RIA) and less than 2 seconds to show the data (RadGrid1.ItemsSource = ctx.VEntities;) what is excelent!

    The third scenario is my big problem, the system takes more than 15 Seconds to perform the load...

    My first conclusion was "OK, I made a mistake" (and I still think that :) but when i perform the same test with other grid component that I'm evaluating also (infragistics) the process (third scenario) takes about 5 seconds...

    Can you help me with that ?

    Thank you,
    Joao

  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 29 Apr 2010 Link to this post

    Hi Joao,

    Not sure why you have such problems however you can check my blog post to know more about the grid performance with WCF Ria services and almost 2 million records.

    Kind regards,
    Vlad
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. joao rodrigues
    joao rodrigues avatar
    20 posts
    Member since:
    Mar 2010

    Posted 30 Apr 2010 Link to this post

    Thank you for your response Vlad.

    Your example reflects almost exacly my 1st scenario and the performance is in fact great.

    My problem is the 3rd scenario:
     
    <my1:RadGridView Name="RadGrid1" AutoExpandGroups="True" ItemsSource="{Binding Path=VEntities}"/>
    ---
    CFDomainContext
    ctx = new CFDomainContext();

    this.DataContext = ctx;

     

    ctx.Load(ctx.GetVEntitiesQuery());
    ---
    Here I bound the ItemsSource to an EntitySet and on load event I call the Load method to fill the entity set.
    I don't know the RadGrid internals but I can imagine that it is doing some processing every time an record is added to EntitySet since the entityset bound to grid ...Maybe I'm wrong...

    Any Ideas ?

  4. joao rodrigues
    joao rodrigues avatar
    20 posts
    Member since:
    Mar 2010

    Posted 30 Apr 2010 Link to this post

    Vlad,

    I've download your RIA Project and made some minor changes to reproduced the behavior.

    I've made it available here  

    1  - in SilverlightApplication1.Web.NorthwindDomainService.cs (Line 146)
    2 - In SilverlightApplication1. MainPage.xaml
        defined 3 column definitions in existing grid 
        added 2 buttons and 2 radgrids
    3 - In SilverlightApplication1. MainPage.xaml.cs
        Some code to fill the new objects 

    Could you please take a look ?

    Thank you,
    joao

  5. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 30 Apr 2010 Link to this post

    Hi Joao,

    Indeed you are right. I've modified your project to illustrate you how to overcome this. You can find the project attached.

    Don't hesitate to contact us if you have other questions.


    Best wishes,
    Vlad
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. joao rodrigues
    joao rodrigues avatar
    20 posts
    Member since:
    Mar 2010

    Posted 30 Apr 2010 Link to this post

    Hi Vlad,

    Your solution worked perfectly!

    And to be honest I now understand why the previous implementation was slow.

    Yet, let me say that I would love if RIA (or INotifyCollectionChanged) and RadGrid could have a smother conversation like :

    • RIA : Hey, I'll start to update the EntitySet.
    • RADGrid: Ok, I'll wait for you to finish.
    • RIA: Hey, I've finished updating the Entity set.
    • RADGrid: Ok, let me hurry up to update myself.

    Well, maybe in the future they have... :)

    Vad, Thank you very much!


  7. Arcadia_User
    Arcadia_User avatar
    7 posts
    Member since:
    Aug 2010

    Posted 04 Oct 2010 Link to this post

    I am evaluating Grid now and I have the same problem. We are going to move from Silverlight Toolkit grid (which is free, fast, and stable, but seriously lacks features) to some commercial grid.

    Grid is bound to EntitySet with ~1000 records, and browser freezes for 4 seconds when data finishes loading (and I have 3.2GHz Core 2 Duo. Our customers use notebooks with slower processors). This is not an issue with Toolkit grid and Syncfusion grid.

    Situation is many times worse if I have pre-defined GroupDescriptor.

    I see that solution is to bind grid AFTER data has been loaded, but this looks like a bad workaround (EtitySet implements INotifyCollectionChanged, why should I care) and not always easy to do (I have multiple queries loading and tracking all of them would be a pain).

    This thing is the only concern about Telerik grid by far; other things look perfect. Is there any chance that it will be fixed?

  8. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 05 Oct 2010 Link to this post

    Hi Pavel,

     Can you send us your application (via support ticket) to check locally what is going on?

    Sincerely yours,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. Arcadia_User
    Arcadia_User avatar
    7 posts
    Member since:
    Aug 2010

    Posted 05 Oct 2010 Link to this post

    Support ticket with sample application added (354351)
  10. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 05 Oct 2010 Link to this post

    Hello Pavel,

     I've checked the project attached to the support ticket however I'm unable to run it since your are using old version (not the official one) of RIA Services. I've noticed however that grids in your case are inside StackPanel which will measure the grid with infinity height .In this case the grid virtualization will be off and all rows will be created at once. If you to get more info about the performance of RadGridView and RadDataPager bound to WCF RIA Services you can check my blog post

    All the best,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  11. Arcadia_User
    Arcadia_User avatar
    7 posts
    Member since:
    Aug 2010

    Posted 05 Oct 2010 Link to this post

    Sorry, I've attached completely wrong archive. I've added correct one to the case reply.

    Grid is not in StackPanel, and explicit height does not help also. (See MainPage.xaml)

    Pager is not suitable for us, we need grid to display (group, sort, filter) up to 3000-5000 records at once (column count around 10). This is not so much I think. Toolkit grid handles this pretty well. Telerik grid does this also well, except this one freeze when EtitySet gets populated. This is really the only concern.

  12. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 05 Oct 2010 Link to this post

    Hello Pavel,

     I've reviewed your new project and now I see your point. We've found the problem immediately and we will do our best to fix it as soon as possible - unfortunately I'm not sure if we will make it for our upcoming latest build (this Friday).

    You can track the issue here - I've added 3000 Telerik points to your account. 

    Greetings,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  13. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 06 Oct 2010 Link to this post

    Hi Pavel,

     Just to let you know that this issue was resolved successfully and the fix will be part of our upcoming latest build this Friday. 

    Kind regards,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  14. Arcadia_User
    Arcadia_User avatar
    7 posts
    Member since:
    Aug 2010

    Posted 06 Oct 2010 Link to this post

    This is just great, thank you!
  15. Evaluator
    Evaluator avatar
    3 posts
    Member since:
    Nov 2009

    Posted 18 Feb 2011 Link to this post

    Could this solution be explained? Downloading two different solutions are digging through the differences is going to be a bit painful.
  16. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 18 Feb 2011 Link to this post

    Hello,

     There was an issue reported in this thread which is already fixed several moths ago. 

    Greetings,
    Vlad
    the Telerik team
  17. KI performance
    KI performance avatar
    13 posts
    Member since:
    Jun 2013

    Posted 12 Jun 2013 Link to this post

    Hi there,
    i have a similar problem with slow data binding in a radgridview :/

    i have a page with two gridviews. one is collapsed, one is visible. in each grid are ~25 - 30 Rows and ~14 Colums! 

    i have 2 viewmodels for each grid and i`m binding a static ObservableCollection with custom Itemclasses(~14 properties, just strings, few datetimes, few ints) on the itemsources.

    to render the page with all 14 columns, it takes ~2secounds...with one column its fast!

    its a blank gridview with autogeneratedcolums=true. 

    some hinds?

    Greetings

    PageConstructor:
    if (retailersViewModel == null)
                {
                    retailersViewModel = this.Resources["retailersViewModelView"] as RetailersViewModel;              
                    retailerDataGrid.ItemsSource = retailersViewModel.RetailersViewCollection;
                }

    <telerik:RadGridView  x:Name="retailerDataGrid"
                          Visibility="Visibile"
                          AutoGenerateColumns="True"
                          Margin="0,50,0,50"  >

  18. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 17 Jun 2013 Link to this post

    Hello,

    Generally related to performance I would suggest you to check this help article.
    Then I must mention that the first time when the control is opened, there are many visuals to be loaded and this takes time. So I can also suggest you to use NoXaml binaries and Implicit Styles as explained in our online documentation

    Regards,
    Didie
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top