Hi I need radbusyindicator to show while information is being loaded. I am not using MVVM, code is written in code behind. I am including the code here. Right now, the busyindicator only loads after radgridview is already loaded. Can you please help me.
<telerik:RadBusyIndicator x:Name="busyIndicator" Grid.Row="1" />
private void LoadAnswers(Int64 inputSurveyId = 0)
{
busyIndicator.IsBusy = true;
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate()
{
//busyIndicator.IsBusy = true;
if (inputSurveyId > 0)
{
//busyIndicator.IsBusy = true;
loadList.Clear();
loadList.AddRange(saf.GetAnswerUnfilteredE(inputSurveyId));
workList.Clear();
workList.AddRange(loadList);
}
else
{
loadList.Clear();
//busyIndicator.IsBusy = true;
loadList.AddRange(saf.GetAllE());
workList.Clear();
workList.AddRange(loadList);
}
QueryableCollectionView qCV = new QueryableCollectionView(workList);
rgvAnswers.DataContext = qCV;
rgvAnswers.ItemsSource = qCV;
rgvAnswers.Rebind();
//busyIndicator.IsBusy = false;
});
}
<telerik:RadBusyIndicator x:Name="busyIndicator" Grid.Row="1" />
private void LoadAnswers(Int64 inputSurveyId = 0)
{
busyIndicator.IsBusy = true;
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate()
{
//busyIndicator.IsBusy = true;
if (inputSurveyId > 0)
{
//busyIndicator.IsBusy = true;
loadList.Clear();
loadList.AddRange(saf.GetAnswerUnfilteredE(inputSurveyId));
workList.Clear();
workList.AddRange(loadList);
}
else
{
loadList.Clear();
//busyIndicator.IsBusy = true;
loadList.AddRange(saf.GetAllE());
workList.Clear();
workList.AddRange(loadList);
}
QueryableCollectionView qCV = new QueryableCollectionView(workList);
rgvAnswers.DataContext = qCV;
rgvAnswers.ItemsSource = qCV;
rgvAnswers.Rebind();
//busyIndicator.IsBusy = false;
});
}