GroupCollapsing Event (SfListView)

Occurs when a group is being collapsed.
public event GroupExpandCollapseChangingEventHandler GroupCollapsing
Event Data

The event handler receives an argument of type GroupExpandCollapseChangingEventArgs containing data related to this event. The following GroupExpandCollapseChangingEventArgs properties provide information specific to this event.

(Inherited from System.ComponentModel.CancelEventArgs)
Gets a list that corresponding groups being expanded or collapsed in view.  
The GroupCollapsing event is a cancelable event and can be canceled by handling the event and setting the Cancel property to true. However, if the event is canceled, the group collapsing process for the tapped GroupHeaderItem gets cancelled. Also, we can customize the group being collapsed through GroupExpandCollapseChangingEventArgs event argument.
The following example demonstrates how to wire the group collapsing event in SfListView.
listView.GroupCollapsing += ListView_GroupCollapsing;
private void ListView_GroupCollapsing(object sender, GroupExpandCollapseChangingEventArgs e)
   if (e.Groups[0] == listView.DataSource.Groups[0])
       e.Cancel = true;

Syncfusion.SfListView.XForms: 17.2451.0.34

See Also