CollapseAll and ExpandAll not working

Hi,

i have the newest version of everything installed (Xamarin.Forms 3.2.0.839982, Syncfusion NuGets 16.3.0.21, VisualStudio 2017 15.8.5, Xcode 10, iOS 12).

For my Xamarin.Forms project the CollapseAll and ExpandAll methods of SfListView are not working (all Groups are keeping expanded).

Ive implemented it like in the documentation:
https://help.syncfusion.com/xamarin/sflistview/grouping

In XAML ive setted for the SfListView: AllowGroupExpandCollapse="True"

Ive also tried to use Binding of isExpand field of GroupResult, seams not to work too (not getting any value returned).

Someone knows what the problem could be?

Regards,
Thomas


3 Replies

JN Jayaleshwari N Syncfusion Team September 26, 2018 11:47 AM UTC

Hi Thomas,  
  
Thanks for using Syncfusion product.  
  
We have checked the reported query from our end. We suspect that you might have used Listview.CollapseAll / Listview.ExpandAll method in the constructor itself to use it initially while loading. If yes, we would like to know that you can use ListView.Loaded event to CollapseAll / ExpandAll the groups initially while loading listview. Maybe the CollapseAll method will be fired before initializing the group descriptors. If that’s not a case, please share details about how you are trying to use CollapseAll/ExpandAll method which will help us to analyze your query better and provide appropriate solution from our end.  
  
We have attached the sample for your reference below please find the sample from below link.  
  
  
  
listView.Loaded += ListView_Loaded;  
  
private void ListView_Loaded(object sender, ListViewLoadedEventArgs e)  
 
     listView.CollapseAll();  
 
  
  
Regards,  
Jayaleshwari N 



UN Unknown Syncfusion Team September 26, 2018 02:43 PM UTC

Hi Jayaleshwari,

ive implemented it that way you are describing, here my codebehind and xaml:

Codebehind:

        public OrderPage()
        {
            InitializeComponent();
            InitListView();
            orderVM = new OrderViewModel();
            BindingContext = orderVM;           
        }

        private void InitListView()
        {
            var dateGroupDiscriptor = new GroupDescriptor()
            {
                PropertyName = "GroupingDateText",               
                Comparer = new DateTextGroupingComparer()
            };

            listView.DataSource.GroupDescriptors.Add(dateGroupDiscriptor);

            listView.Loaded += ListView_Loaded;
        }

        private void ListView_Loaded(object sender, ListViewLoadedEventArgs e)
        {
            listView.CollapseAll();
        }

FYI: Ive changed the "<" and ">" to "//" because the XAML wasnt show correctly here:

XAML:
//syncfusion:SfListView x:Name="listView" ItemsSource="{Binding Orders}"
                               TapCommand="{Binding TappedCommand}" AutoFitMode="Height"
                               AllowGroupExpandCollapse="True" SelectionMode="None" ItemSpacing="2.5"//
          
            //syncfusion:SfListView.GroupHeaderTemplate//
                //DataTemplate//
                    //StackLayout Margin="5" Orientation="Horizontal"//
                        //Label Text="{Binding Key}" FontSize="Large" TextColor="White" HorizontalOptions="StartAndExpand" ///
                        //Label Text="{Binding Count}" FontSize="Large" TextColor="White" ///                      
                    ///StackLayout//
                ///DataTemplate//
            ///syncfusion:SfListView.GroupHeaderTemplate//
            ...........
            ...........
            ...........


JN Jayaleshwari N Syncfusion Team September 27, 2018 11:29 AM UTC

Hi Thomas,  
  
Please follow the incident created under your account for the same query.  
  
Regards,  
Jayaleshwari N 


Loader.
Up arrow icon