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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfListView GroupHeader crash when tapped

Thread ID:

Created:

Updated:

Platform:

Replies:

150730 Jan 17,2020 11:50 AM UTC May 15,2020 04:13 AM UTC Xamarin.Forms 3
loading
Tags: SfListView
Kien.Phat
Asked On January 17, 2020 11:50 AM UTC

Hi, i'm want to report a issue.

In my project, i'm using SfListView and when customize Group header with Header Template and using StickyHeader.

If i'm tapping to Group Header it'll crash immediately, then i'm trying add TapGestureRecognizer to GroupHeader and the issue is resolve.

That's it, i just want to report a issue to you guy.

Gnana Priya Namasivayam [Syncfusion]
Replied On January 20, 2020 08:49 AM UTC

Hi Kein, 
 
Thanks for using Syncfusion products. 
 
We have checked the SfListview sample with sticky GroupHeader in latest version. On tapping group header, it expands/collapse as expected but we did not face any crash. We have attached the tested sample for your reference, please find the sample from below. 
 
 
Can you please check with the above sample whether reported issue replicates in our sample also. If not, kindly share your complete xaml (loaded with listview) and related code snippets or revert us back with the modified sample to replicate the reported issue so that we can analyze and provide appropriate solution at our end. 
 
 
Regards, 
Gnana Priya N 


Kien.Phat
Replied On January 20, 2020 09:11 AM UTC

Oh, it's my fault for providing incomplete information to you guy.

I am binding Tap Command to SfListview so when any item is tapped it will open SfPopup and pass the tapped item's data to Sfpopup for display. 

And for that script, i think if GroupHeader is tapped it's will count as item tapped and doesn't have any data to transmit over SfPopup so it will crash.

My XAML:

<SfListView ItemsSource={Binding ProductList}
                  IsStickyGroupHeader="True"
                  TapCommand="{Binding ItemTapCommand}" >
<SfListView.DataSource>
                                <DataSource>
                                    <DataSource.GroupDescriptors>
                                        <GroupDescriptor PropertyName="Type"/>
                                    </DataSource.GroupDescriptors>
                                </DataSource>
                            </SfListView.DataSource>
                            <SfListView.GroupHeaderTemplate>
                                <DataTemplate>
                                    <ViewCell>
                                        <ViewCell.View>
                                            <StackLayout BackgroundColor="WhiteSmoke">
                                                <Label Text="{Binding Key}"
                                                       FontSize="20"
                                                       TextColor="Black"
                                                       FontAttributes="Bold"
                                                       VerticalOptions="Center"
                                                       HorizontalOptions="Start"
                                                       Padding="15,7,0,7" />
                                            </StackLayout>
                                        </ViewCell.View>
                                    </ViewCell>
                                </DataTemplate>
                            </SfListView.GroupHeaderTemplate>
                            <SfListView.ItemTemplate>
                                   .........
                            </SfListView.ItemTemplate>
</SfListView>

 <SfPopupLayout IsOpen="{Binding PopupIsOpen}">
                <SfPopupLayout.PopupView>
                    <PopupView>
                       ........
                    </PopupView>
               </SfPopupLayout.PopupView>
</SfPopupLayout>

Gnana Priya Namasivayam [Syncfusion]
Replied On January 21, 2020 06:55 AM UTC

Hi Kien, 
 
We have prepared the sample to display Sfpopup using TapCommand of SfListView. We would like to inform that GroupHeader’s BindingContext will GroupResult which contains Items, Key, Level, Count, SubGroups & IsExpand and ItemTemplate’s BindingContext will be Model properties. We are not clear how you are accessing the data in your tapcommand meanwhile we suggest you to check like below to avoid the reported crash. 
                                                                                                          
 
private void OnTapCommand(object e) 
{ 
   var eventArgs = (e as Syncfusion.ListView.XForms.ItemTappedEventArgs); 
   if (eventArgs.ItemType == ItemType.Record) 
    { 
    } 
} 
 

 
We have attached the tested sample for your reference, please find them from below. 
 
Could you please share details about how you are handling Tapped event. Possibly sharing the code snippet used in tapped event helps us to provide the solution at the earliest as possible.  

Please let us know if you need any further assistance. 
 
Regards, 
Gnana Priya N 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon