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); } } }
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); } } }
private void ListView_GroupCollapsing(object sender, GroupExpandCollapseChangingEventArgs e) { // if (e.Groups[0] == listView.DataSource.Groups[0]) // e.Cancel = true; }