RadBusy indicator not displayed in UI where RadGrid loads huge records

1 Answer 213 Views
GridView
Divya
Top achievements
Rank 1
Divya asked on 16 Jun 2021, 01:48 PM

Hi,

I am having a WPF window with few grids containing rows varying from 2-100.  When I click on a link from a previous window, this window has to be loaded. I have used RadBusyIndicator for the entire content. And the grid population  LoadData() is being done in Tasks which is called on Window Loading. So presently my UI is displayed with all the grid without any contents and maybe after 4-5 seconds, the contents are loaded. 

I want to display the RadbusyIndicator when no contents are present and once the contents appear, it should disappear. Please find the below code I have implemented.  But in this case, RadBusyIndicator is not displayed. Kindly help.

An alternative that works presently is to put DisplayAfter = 0, here the indicator appears though it doesn't spin and later vanish when data loads.

public void LoadData( string filePath)

        {
            this.IsBusy = true;

            Task.Factory.StartNew(() => {
                OnPopulateDataDoWork(filePath);
            }).ContinueWith(t =>
            {
                this.IsBusy = false;
            }, TaskScheduler.FromCurrentSynchronizationContext());


Thanks,

Divya

 

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 21 Jun 2021, 09:25 AM

Hello Divya,

Thank you for the provided information. 

Please, allow me to start by saying that RadBusyIndicator is a UI element and as any other UI element it is shown on the UI thread. This means that when the UI thread is busy the RadBusyIndicator will be frozen. Based on the provided description, it seems that although the data is loaded in the background, the UI thread is busy in your scenario.

You can take a look at the following article in our documentation: Integrate with services and a RadWindow, which demonstrates how the RadBusyIndicator can be setup with background tasks. Alternatively, you can also consider displaying a busy indicator on a separate thread. You can check out an example approach in the following article: Creating a Busy Indicator in a separate thread in WPF.

I hope you find this information helpful.

Regards,
Vladimir Stoyanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
GridView
Asked by
Divya
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or