Example #1
0
 private void ListView_GroupExpanding(object sender, GroupExpandCollapseChangingEventArgs e)
 {
     if (e.Groups.Count > 0)
     {
         var group = e.Groups[0];
         if (expandedGroup == null || group.Key != expandedGroup.Key)
         {
             foreach (var otherGroup in listView.DataSource.Groups)
             {
                 if (group.Key != otherGroup.Key)
                 {
                     listView.CollapseGroup(otherGroup);
                 }
             }
             expandedGroup = group;
             listView.ExpandGroup(expandedGroup);
         }
     }
 }
Example #2
0
        private void ListView_GroupExpanding(object sender, GroupExpandCollapseChangingEventArgs e)
        {
            if (e.Groups.Count > 0)
            {
                var group = e.Groups[0];
                if (expandedGroup == null || group.Key != expandedGroup.Key)
                {
                    foreach (var otherGroup in listView.DataSource.Groups)
                    {
                        if (group.Key != otherGroup.Key)
                        {
                            listView.CollapseGroup(otherGroup);
                        }
                    }

                    expandedGroup = group;
                    listView.ExpandGroup(expandedGroup);
                    int index = listView.DataSource.DisplayItems.IndexOf(expandedGroup);
                    listView.LayoutManager.ScrollToRowIndex(index, Syncfusion.ListView.XForms.ScrollToPosition.Center, true);
                }
            }
        }
Example #3
0
        private void ListView_GroupCollapsing(object sender, GroupExpandCollapseChangingEventArgs e)
        {
//            if (e.Groups[0] == listView.DataSource.Groups[0])
//                e.Cancel = true;
        }