We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to clear grouping when long pressing on a caption row?

SfDataGrid fires the SfDataGrid.GridLongPressed event when the grid is long pressed. You can perform any desired operation upon long pressing by handling the GridLongPressed event. The GridLongPressed event provides you with the arguments “RowIndex and RowData” (the underlying data associated with the row based on the row type) there by allowing you to customise the long press event based on the requirements.

The SfDataGrid fires this event for all type of rows such as header row, caption summary rows and data rows. When you long press the header row the associated GridColumn of the long pressed header cell is passed as RowData. When you long press the data rows, the underlying data object associated with the long pressed row is passed as RowData. When you long press the caption rows, the group information associated with the long pressed caption row is passed as RowData. Thus by checking whether the RowData is a “Group” you can clear the grouping in SfDataGrid by clearing the SfDataGrid.GroupColumnDescriptions collection.

 

Refer the following example which illustrates clearing the grouping in a SfDataGrid when long pressing a caption row by handling the GridLongPressed event.

 

Refer the following screenshot for the final outcome upon execution of the above code

The working sample for this KB can be downloaded from the following link
http://www.syncfusion.com/downloads/support/directtrac/general/ze/LongPress511868129

Article ID: Published Date: Last Revised Date: Platform: Control:
6373 02/19/2016 02/19/2016 Xamarin.iOS SfDataGrid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon