|
listView.Loaded += ListView_Loaded;
private void ListView_Loaded(object sender, ListViewLoadedEventArgs e)
{
listView.CollapseAll();
} |
| 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// ........... ........... ........... |