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

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

11 Answers 116 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 2
Iron
Iron
Pierre asked on 05 Jul 2010, 03:32 PM
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.

11 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 05 Jul 2010, 03:48 PM
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
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 05 Jul 2010, 03:57 PM
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?
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 05 Jul 2010, 03:57 PM
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?
0
Accepted
Vlad
Telerik team
answered on 05 Jul 2010, 04:12 PM
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
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 05 Jul 2010, 04:23 PM
Thank! That work like a charm!
0
Rodney Foley
Top achievements
Rank 1
answered on 08 Nov 2010, 11:23 PM
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.
0
Vlad
Telerik team
answered on 09 Nov 2010, 08:25 AM
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
0
Rodney Foley
Top achievements
Rank 1
answered on 09 Nov 2010, 04:22 PM
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.
0
Vlad
Telerik team
answered on 09 Nov 2010, 04:29 PM
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
0
Rodney Foley
Top achievements
Rank 1
answered on 09 Nov 2010, 05:00 PM
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.
0
Vlad
Telerik team
answered on 09 Nov 2010, 05:08 PM
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
Tags
GridView
Asked by
Pierre
Top achievements
Rank 2
Iron
Iron
Answers by
Vlad
Telerik team
Pierre
Top achievements
Rank 2
Iron
Iron
Rodney Foley
Top achievements
Rank 1
Share this question
or