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

How to set DataLoadMode to work

3 Answers 142 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Adiel
Top achievements
Rank 2
Adiel asked on 17 Jun 2009, 02:24 PM
Hi
I have an async data source in my ViewModel class.
I want to force the grid to show it's animation.
I set that DataLoadMode property to Asynchronous but it's not working (the grid don't know that there is background operation)
How can I make it work?
(In silverlight it was IsBusy state but here it's readonly )
Thanks
Adiel

3 Answers, 1 is accepted

Sort by
0
Allan
Top achievements
Rank 1
answered on 17 Jun 2009, 05:07 PM
Aidel

That is not how it is designed to work from what I have seen.

The animation will show whilst the ItemsSource is being populated - so if your read operation assigns the return value into the ItemsSource, you will see the behavior you want. Be warned that if you are loading a large amount of data, the animation will only run whilst ItemsSource is being populated - it will freeze when the grid is being drawn, as the UI thread cannot handle both tasks at once. WPF still has the same limitation as WinForms, in that all UI operations happen on the same UI thread (if I'm incorrect here, someone feel free to correct me).
0
Allan
Top achievements
Rank 1
answered on 17 Jun 2009, 05:29 PM
Aidel

This article explains what I was talking about

http://weblogs.asp.net/cschittko/archive/2008/05/14/wpf-ui-update-from-background-threads.aspx

You may want to look into using a BackgroundWorker control and a progress bar ... may serve your purposes better.
0
Adiel
Top achievements
Rank 2
answered on 18 Jun 2009, 07:07 AM
Thanks guys.
I'll look at some solution and let every one know if I'll found something interesting
Adiel
Tags
GridView
Asked by
Adiel
Top achievements
Rank 2
Answers by
Allan
Top achievements
Rank 1
Adiel
Top achievements
Rank 2
Share this question
or