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

RadDataFilter, RadGridView, RadDataPager, and QueryableCollectionView

2 Answers 218 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Carl Herlitz
Top achievements
Rank 1
Carl Herlitz asked on 07 Jul 2015, 09:40 PM

Hello,

I have an application where I have a RadDataFilter, RadGridView, and RadDataPager all connected to a QueryableCollectionView, fed by an IQueryable query provided by Entity Framework 6.1. See below for sample code

I've read in some other forum posts and articles, DataLoadMode="Asynchronous" is not recommended, and I see why. I'm getting a couple of interesting bugs.

1) We often need to change the query that's bound to the grid (but still bound to the same entity type). As I don't see a way to change it for the existing, bound QueryableCollectionView, I just create and assign a new QueryableCollectionView to the QCV property in my view model (this raises a PropertyChanged event). When I try this, the busy indicator stays on after loading and displaying the data, behind the spinner. Going to another page, sorting, or filtering will remove the spinner.

2) When paging and filtering, the first half of the items in the grid are hidden, while the other half stays visible, behind the spinner. This isn't really a functional issue, but it looks a bit weird, and distracting.

As I mentioned before, I know that your suggestion is to not set DataLoadMode="Asynchronous", but then in that case, is there no way that I can asynchronously load data using an IQueryable from Entity Framework, with the Busy Indicator, that works properly? I can't block the UI thread in our application while loading data. Some of our queries are complex and can take 5+ seconds to respond. I don't mind the time it takes, but I do mind that the user can't interact with the UI during that time.

Is there another class I can use? Some provider classes I can extend? This was very simple to do in Silverlight with WCF and the QueryableDomainServiceCollectionView. I'm surprised how this isn't as simple for WPF and Entity Framework.

 

IQueryable<Entity> qry = _service.GetEntities();
QCV = new QueryableCollectionView(qry);

 

 

<telerik:RadDataFilter Source="{Binding Items, ElementName=DataGrid}" />
<telerik:RadGridView x:Name="DataGrid"               
                     DataLoadMode="Asynchronous"
                                             ItemsSource="{Binding QCV}" />
<telerik:RadDataPager Source="{Binding Items, ElementName=DataGrid}"
                                              PageSize="25" />

 

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 10 Jul 2015, 12:41 PM
Hi Carl,

Why not working with IsBusy property of RadGridView ? You can bind it to a property in your ViewModel and update it on performing the heavy operations of refreshing the source. 

Regards,
Maya
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Carl Herlitz
Top achievements
Rank 1
answered on 29 Jul 2015, 02:21 PM

FYI, I got an answer from Telerik in a support ticket.

Their answer was that they do not have out-of-the-box support for async data load with Entity Framework in WPF using the QueryableCollectionView.

Tags
GridView
Asked by
Carl Herlitz
Top achievements
Rank 1
Answers by
Maya
Telerik team
Carl Herlitz
Top achievements
Rank 1
Share this question
or