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"
/>