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:
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>
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.
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.