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

QueryableDomainServiceCollectionView, RadDataPager and Filtering

6 Answers 58 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rob Conley
Top achievements
Rank 1
Rob Conley asked on 16 Jan 2013, 09:05 PM
I'm looking at this example http://demos.telerik.com/silverlight/#DomainDataSource/FirstLook. I'm actually implementing at TreeListview instead of a GridView, but I think it should be the same.

Also, instead of using a RadDomainDataSource I'm implementing a QueryableDomainServiceCollectionView.

Problem is, my filter query values are not being pushed back to the server. All the filtering is happening with the currently loaded data.

I don't see any magic in the example that wires up the filter descriptors to get them to pass through. Before I post code, can anyone tell me what I am missing in getting the FilterDescriptors to pass through?

-Rob

6 Answers, 1 is accepted

Sort by
0
Rob Conley
Top achievements
Rank 1
answered on 17 Jan 2013, 02:01 AM
Looks like the GridView works in this manner, but the TreeListView does not.

I was thinking that under the covers the TreeListView was a GridView.

Is there any chance that this can be made to work?
0
Vlad
Telerik team
answered on 17 Jan 2013, 07:52 AM
Hello,

 Indeed this is customized version of the grid itself however the treelist cannot work on the server since the component will need to apply all operations like sorting, filtering, aggregates, etc. hierarchically.

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rob Conley
Top achievements
Rank 1
answered on 17 Jan 2013, 03:05 PM
All I'm looking for is for the top level to be refreshed from the server. Since I was then going to load the nested levels on demand, it seems plausible that it could act the same way as the grid in that respect. Even if I had a defined hierarchy with EF entities or something it seems like reloading the data with filters applied would not be a show-stopper.

I will take a quick look at applying the filters myself and switch back to the grid if that doesn't work.

Thanks,
Rob
0
Rob Conley
Top achievements
Rank 1
answered on 17 Jan 2013, 05:16 PM
I added a "where" FilterDescriptor to my QDSCV as documented at http://blog.falafel.com/blogs/11-03-18/RadDomainDataSource_and_being_MVVM_Friendly. Unfortunately, the RadTreeListView seems to want to hang on to the paged data it has a not "rebind" to my QDSCV. In other words, it simply filters the paged data it already has.

I'll revert back to the Grid unless you have any other suggestions.

-Rob
0
Rob Conley
Top achievements
Rank 1
answered on 17 Jan 2013, 08:37 PM
"Upon further review", this seams to work. Vm is the ViewModel. Level1 is the QueryableDomainServiceCollectionView. This code is in the view codebehind.

I'm getting more than 1 hit on the database however. Perhaps the Rebind is unnecessary?

Can you confirm that this in theory is a reasonable approach? That is, clearing the QDSCV filterdescriptors and adding the TreeListView descriptors to the QDSCV? Is there a better event to be applying this logic?
private void MyTreeList_OnFiltered(object o, GridViewFilteredEventArgs e)
{
  Vm.Level1.FilterDescriptors.Clear();
  MyTreeList.FilterDescriptors.ToList().ForEach(fd => Vm.Level1.FilterDescriptors.Add(fd));
  MyTreeList.Rebind();
0
Vlad
Telerik team
answered on 22 Jan 2013, 02:13 PM
Hello,

 Rebind() is not necessary since Add() will trigger automatic refresh of the source. 

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Rob Conley
Top achievements
Rank 1
Answers by
Rob Conley
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or