Hi Customer,
Thank you for using Syncfusion Products.
We have checked the reported query “Need to Collapse all other groups when one group is expanded” at our end and we would like to let you know that the reported requirement can be achieved by using GroupExpanding event which will be triggered whenever a particular group is being expanded and the particular selected group can be get from GroupExpandCollapseChangingEventArgs by which you can compare and collapse all other groups and expand the particular selected group as highlighted in the below code snippets.
Code Example[C#]:
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);
}
}
} |
For your assistance we have prepared a working sample and you can download it from the below link.
Please let us know if you require further assistance.
Regards,
Dinesh Babu Yadav