Grid performance issue. Meaby i do it the wrong way.

12 posts, 1 answers
  1. Pierre
    Pierre avatar
    212 posts
    Member since:
    Apr 2007

    Posted 05 Jul 2010 Link to this post

    Hi, i have a search grid that disply some result. All my initial test was working great until I filled up my database with real data. The database contain 62000 element and depending of the search criteria the result may have a lot rows. But in you 1 mil. demo all work correctly. The RIA query return very fast to client with all the data. The delay occurn in the AddRange of the RadObservableCollection and after in the binding process.

    I first try in my viewmodel to transfert the IEnumerable<RechResultat> (e.Result) from my RIA context to a RadObservableCollection then bind the grid on it. With breakpoint, I can see the the RIA Asynch response are fast. But The code stuck for a while in the AddRange step. After this step the silverlight client do not respond anymore. I wait more then 4 min but the SL client still in not responding.
    After that I try to bin my radGridView directly on the IEnumerable instead of using a radOC. This time after wainting a while the grid display somes result, but the waiting is long!

    What do i do wrong?

    My grid:
    <telerik:RadGridView Name="GridResultat" IsReadOnly="True" CanUserFreezeColumns="False" CanUserReorderColumns="true" ShowGroupPanel="False" IsFilteringAllowed="false"   
      AutoGenerateColumns="False" ItemsSource="{Binding RechResultat}">  
      <telerik:RadGridView.Columns> 
         <telerik:GridViewDataColumn Header="ID" DataMemberBinding="{Binding RessourceID}" IsVisible="False" UniqueName="RessourceID" /> 
         <telerik:GridViewDataColumn Header="No Membre" DataMemberBinding="{Binding NoCarte}" MinWidth="40" UniqueName="NoCarte" /> 
         <telerik:GridViewDataColumn Header="Prenom" DataMemberBinding="{Binding Prenom}" MinWidth="100" UniqueName="Nom" /> 
         <telerik:GridViewDataColumn Header="Nom" DataMemberBinding="{Binding Nom}" MinWidth="100" UniqueName="Prenom" /> 
      </telerik:RadGridView.Columns> 
    </telerik:RadGridView> 

    My Viewmodel:
    This is the Callback function of My RIA one. See in comment the way I do with the RadObeservableCollection.
    RechResultat is a property and the grid use it for binding. In this example, the type is a IEnumerable<RechResultat> but with the code in comment the type was RadObservableCollection<RechResultat>
            private void GetRechercheRessourceComplete(object sender, EntityResultsArgs<RechRessource> e)  
            {  
                if (e.Error != null)  
                {  
                    //TODO: Gestion erreur ErrorMessage = e.Error.Message;  
                }  
                else 
                {  
                    //RechResultat.Clear();  
                    //RechResultat.AddRange(e.Results);  
                    RechResultat = e.Results;  
     
                }  
                RechEnCour = false;  
            } 

    Thank for your help

    Edit: Meaby a more efficient way is to use the Take and Skip Linq function to limit the result. But the goal of this search for now is to display all the result. For now RIA handle very fast (less than a second) query that return only 4000-5000 elements the problem are client side in the Binding process.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 05 Jul 2010 Link to this post

    Hi Pierre,

     Can you verify if the grid is not measured with infinity height in your case? This can happen if the grid is inside StackPanel, ScrollViewer or in Grid.Row with Height set to Auto.

    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. DevCraft banner
  4. Pierre
    Pierre avatar
    212 posts
    Member since:
    Apr 2007

    Posted 05 Jul 2010 Link to this post

    Yes the grid is set in infinity height inside StackPanel then inside an ScrollViewer. I set the MaxHeight property equel to 300 and the grid now redering very fast with the IEnumerable;

    What About the addRange? I still have a significan delay there if the result are big. Meaby the more efficient way for search engine like that is to use the IEnumerable data directly?
  5. Pierre
    Pierre avatar
    212 posts
    Member since:
    Apr 2007

    Posted 05 Jul 2010 Link to this post

    Yes the grid is set in infinity height inside StackPanel then inside an ScrollViewer. I set the MaxHeight property equel to 300 and the grid now redering very fast with the IEnumerable;

    What About the addRange? I still have a significan delay there if the result are big. Meaby the more efficient way for search engine like that is to use the IEnumerable data directly?
  6. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 05 Jul 2010 Link to this post

    Hi Pierre,

     With RadObservableCollection<> you can use SuspendNotifications() and ResumeNotifications() methods when adding data.

    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
  7. Pierre
    Pierre avatar
    212 posts
    Member since:
    Apr 2007

    Posted 05 Jul 2010 Link to this post

    Thank! That work like a charm!
  8. Rodney Foley
    Rodney Foley avatar
    54 posts
    Member since:
    Oct 2009

    Posted 08 Nov 2010 Link to this post

    Vlad,

    Are there plans to address this, as I would consider this a BUG?  If you are slow performance on the default settings of the height then you should find a way to fix that.  Infinity is a valid setting for height, and maxheight.
  9. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 09 Nov 2010 Link to this post

    Hello,

     Do you have different experience with other components similar to RadGridView. In my opinion you will get exactly the same behavior with simple ListBox, standard Silverlight DataGrid, etc. 

    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
  10. Rodney Foley
    Rodney Foley avatar
    54 posts
    Member since:
    Oct 2009

    Posted 09 Nov 2010 Link to this post

    Vlad,

    I have never had this issue with any of the free Toolkit items, only with yours.  Even if I did, you are supposed to be better than them not the other way around?  Your goal is not to be equal to the free components but better.  You are supposed to be providing a value add, however in this area you are not.
  11. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 09 Nov 2010 Link to this post

    Hello,

     I'm just trying to point that this is the default behavior in both Silverlight and WPF world. 

    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
  12. Rodney Foley
    Rodney Foley avatar
    54 posts
    Member since:
    Oct 2009

    Posted 09 Nov 2010 Link to this post

    Vald but it doesn't seem to actually be the default behavior at least not with Silverlight 4.  I have never had any performance issues that I had to resolve by changing the height on my toolkit data driven components.
  13. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 09 Nov 2010 Link to this post

    Hello,

     Every UI virtual component (like RadGridView, DataGrid, ListBox, etc.) when measured with infinity will try to create all items at once.

    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
Back to Top
DevCraft banner