I have a DataGrid that I am loading with a significant number of rows (several hundred).
The process of loading the rows results in the Datagrid momentarily being empty while the data is being ‘dealt with’ by the control, and then a few seconds later the control finishes its work and displays the rows as expected.
Its this ‘few seconds’ that I’d like to show a BusyIndicator to the user as otherwise they see a DataGrid that isn’t loaded. I was kind of hoping to find some events along the lines of ‘Loading’ and ‘Loaded’ etc, so I and set the indicator on and off accordingly.
Anyone have any experience with this situation?
Any input greatly appreciated.
We were facing the exact problem with SL3 and hoped SL4 would be better.
But, as you might have guessed, this scenario is not addressed by the Silverlight runtime, until this date.
We implemented the following workaround for our SL3/4 + WCF application (note we were not using RIA services):
1) Before
wcfservice_LoadDataAsync()– Show Busy Indicator2)
LoadDataAsyncCompletedEvent– Ifarg.HasError()Hide Busy Indicator, else dont hide the busy indicator.3) Databind the datagrid and then Hide Busy Indicator.
This approach of hiding the busy indicator at the UI level enables the busy indicator to be displayed for a bit longer period of time, decreasing the time the blank screen is displayed to the user.
Also, the XAML based busy indicator was itself causing some issues, so we ended up implementing a very light weight HTML based busy indicator that would disable the required portion of the UI using simple div overlay mechanism and an animated GIF.
All this combined decreased the amount of time the blank screen was shown to the user significantly.
I am aware this is not a 100% solution, but with the current version of Silverlight and even v5 Beta, there still isn’t a RenderComplete event which could assist in Hiding the Busy indicator.
Hope it helps!