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

async DataLoad blocks the UI-Thread

1 Answer 456 Views
GridView
This is a migrated thread and some comments may be shown as answers.
developer1
Top achievements
Rank 1
developer1 asked on 04 Jul 2013, 09:36 AM

Hi,

Currently we are dealing with a Problem of a blocking UI-Thread during the Initial dataload of our RadGridView.
Instead of the blocking UI-Thread we would expect the "running" BusyIndicator!
(During different Grid-Opertions (like Paging, Sorting,...) the BusyIndicator is displayed correctly).

We are using Entity-Framework and since we are having a really complex query-logic we are working with IQueryable Sources.
We have tried to set the data through Dependency-Property-Binding and also tried it manually.
As we found in the web the IQueryable-Source should be the best solution for large amount of data - isn't it?

Here are our attempts:
1) Using an IQueryable Dependency-Property

public static readonly DependencyProperty QueryableSourceProperty =

DependencyProperty.Register("QueryableSource", typeof(IQueryable<Data.TransactionHistory>), typeof(MainWindow), new PropertyMetadata(default(IQueryable<Data.SalesOrderDetail>)));


..
// different conditions... for examp

qeryableSource = queryableSource.OrderBy(o => o.TransactionType);

 

..

ItemsSource="{Binding QueryableSource, ElementName=window}"

2) Setting the ItemsSource-Property of the grid manuelly to our IQueryable

this.radGridElement.ItemsSource = queryableSource;

3) Run all operations asynchronous with Task and Dispatcher

new Task(() => { this.loadData2(); }).Start();


...
Dispatcher.BeginInvoke(
new Action(() => { this.QueryableSource = queryableSource; }));
...

All these samples didn't work as expected.
What's the best solution to bind the Grid on an IQueryable source, so that everything works asynchronously and the BusyIndicator is displayed during the loading-time???

Hopefully you can provide us with a solution...
I can provide you a sample .net application if you send me an upload-link...

Best regards
 Jürgen

1 Answer, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 08 Jul 2013, 01:13 PM
Hello,

This would be expected since in the moment when the UI is blocking,  GridView is actually realizing the items not loading them.
What we would suggest you is to bind RadGridView.IsBusy to a property and to set its value to true before the items start to load and to false when the process is finished.

I hope this helps.


Regards,
Vera
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
developer1
Top achievements
Rank 1
Answers by
Vera
Telerik team
Share this question
or