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

Spinner won't show on grouping, sorting and filtering

1 Answer 117 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jacob
Top achievements
Rank 1
Jacob asked on 15 Sep 2016, 09:26 AM

Hey telerik,

 

My grid's external spinner (RadBusyIndicator) won't work when grouping the grid. It works only when loading data.

Here is some sample code illustrating my scenario:

<telerik:RadBusyIndicator Name="busyIndicator" IsBusy="True" DisplayAfter="0">
           <telerik:RadGridView Name="RadGridView"  ItemsSource="{Binding View}" IsReadOnly="True" Style="{StaticResource VitorStyle}"  AutoGenerateColumns="False">

private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ((ViewModel)DataContext).Load(complete);
            var view = (DataContext as ViewModel).View;
            view.ItemsLoading += View_ItemsLoading;
            view.ItemsLoaded += View_ItemsLoaded;
 
 
            //the spinner wont work for the grouping.
            //this.RadGridView.Grouping += RadGridView_Grouping;
            //this.RadGridView.Grouped += RadGridView_Grouped;
            //this.RadGridView.GroupRowIsExpandedChanging += RadGridView_GroupRowIsExpandedChanging;
            //this.RadGridView.GroupRowIsExpandedChanged += RadGridView_GroupRowIsExpandedChanged;
        }
        //private void RadGridView_GroupRowIsExpandedChanged(object sender, Telerik.Windows.Controls.GridView.GroupRowEventArgs e)
        //{
        //    this.busyIndicator.IsBusy = false;
        //}
 
 
        //private void RadGridView_GroupRowIsExpandedChanging(object sender, Telerik.Windows.Controls.GridView.GroupRowCancelEventArgs e)
        //{
        //    this.busyIndicator.IsBusy = true;
        //}
 
 
        //private void RadGridView_Grouped(object sender, GridViewGroupedEventArgs e)
        //{
        //    this.busyIndicator.IsBusy = false;
        //}
 
 
        //private void RadGridView_Grouping(object sender, GridViewGroupingEventArgs e)
        //{
        //    this.busyIndicator.IsBusy = true;
        //}
 
 
        //B)
        private void View_ItemsLoading(object sender, VirtualQueryableCollectionViewItemsLoadingEventArgs e)
        {
            this.busyIndicator.IsBusy = true;
        }
 
        private void View_ItemsLoaded(object sender, VirtualQueryableCollectionViewItemsLoadedEventArgs e)
        {
            this.busyIndicator.IsBusy = false;
        }

public class ViewModel
{
    public VirtualQueryableCollectionView View { get; set; }
    Controller controller;
 
    public ViewModel()
    {
        controller = new Controller();
    }
    public void Load(bool complete)
    {
        //G the virtual queryable collection. this is the Key Class telerik grid needs to perform the Infinite scrolling. or virtualization.
        View = new VirtualQueryableCollectionView(controller.GetList(complete)) { LoadSize = 10 };
    }
 }

 

This spinning issue has been troubling me for quite some time by now.

It won't show on grouping, sorting and filtering.

 

please send a light

 

Thank you!

1 Answer, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 19 Sep 2016, 11:52 AM
Hello Jacob,

The Grouping, sorting, filtering operations utilize the UI thread and when they are applied the thread is blocked. As the BusyIndicator uses the same UI thread, the behavior you are observing is expected. You can try the suggestion from the following blog post I came across - Creating a Busy Indicator in a separate thread in WPF as there is no straightforward approach to your requirement.

Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
GridView
Asked by
Jacob
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Share this question
or