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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

132934 Sep 28,2017 09:26 PM Sep 29,2017 05:26 AM Xamarin.Forms 1
loading
Tags: SfListView
Emil
Asked On September 28, 2017 09:26 PM

Is it possible to do the same action as below article on SflistView?  I cant figure out because itemholding event is not responding on a group header in sflistview
https://www.syncfusion.com/kb/7372/how-to-clear-grouping-when-long-pressing-on-a-caption-row

Muthu Kumaran Gnanavinayagam [Syncfusion]
Replied On September 29, 2017 05:26 AM

Hi Emil, 
 
We have checked your query “Need to clear Grouping while holding the GroupHeader item” at our end. We regret to let you know that when BackgroundColor is set for the DataTemplate of GroupHeaderTemplate, the ItemHolding will not be triggered. So we have already logged a bug report regarding this issue. Fortunately this issue has been resolved and it will be included in our 2017 Volume 3 SP 2 release. You can clear the Grouping of list items as like the below code snippets. 
 
Code example[XAML]: 
            <listView:SfListView x:Name="listView" 
                           ItemsSource="{Binding contactsinfo}"  
                           ItemHolding="ListView_ItemHolding"> 
 
                <listView:SfListView.GroupHeaderTemplate> 
                    <DataTemplate> 
                        <ViewCell> 
                            <ViewCell.View> 
                                <Grid BackgroundColor="#E4E4E4"> 
                                    <Label Text="{Binding Key}"/> 
                                </Grid> 
                            </ViewCell.View> 
                        </ViewCell> 
                    </DataTemplate> 
                </listView:SfListView.GroupHeaderTemplate> 
            </listView:SfListView> 
 
 
Code example[C#]: 
        private void ListView_ItemHolding(object sender, ItemHoldingEventArgs e) 
        { 
            if (e.ItemType == ItemType.GroupHeader) 
              listView.DataSource.GroupDescriptors.Clear(); 
        } 
 
Please let us know if you require further assistance. 

Regards, 
G.Muthu Kumaran. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.

;