Host a SfListView with AllowSwiping="True" in SfPullToRefresh

Hi,
I'm trying to put a SfListView into a SfPullToRefresh control. This works, however it seems that the sliding behaviour conflicts with the slide down event for the SfPullToRefresh control.

If I try to slide an ListViewItem left, it only works as expected if I slide a little bit up when sliding left. In this case the Slide Down is not triggered from the SfPullToRefresh.

So is there a way or guide to safely host a SfListView with AllowSliding=True in  a SfPullToRefresh control?

<PullToRefresh:SfPullToRefresh 
            Style="{StaticResource DefaultPullToRefreshStyle}"
            IsRefreshing="{Binding IsRefreshing}" 
            RefreshCommand="{Binding RefreshListCommand}"
            >
            <PullToRefresh:SfPullToRefresh.PullableContent>
                <Grid>
                                <controls:SearchableListView
                                    x:Name="ListView"
                                    AllowSwiping="True"
                                    AutoFitMode="Height"
                                    FocusBorderThickness="0"
                                    IsStickyHeader="True"
                                    IsStickyGroupHeader="True"
                                    AllowGroupExpandCollapse="True"
                                    GroupHeaderTemplate="{StaticResource RepetierModelGroupHeaderTemplate}"
                                    ItemsSource="{Binding Actions}"
                                    SelectionGesture="Tap"
                                    HoldCommand="{Binding RunItemFromHoldCommand}"
                                    SelectionMode="None"
                                    SwipeOffset="156"
                                    ItemTemplate="{StaticResource RepetierWebActionTemplate}"
                                    RightSwipeTemplate="{StaticResource EditRunDeleteSwipeRightTemplate}"
                                    >
                                    <controls:SearchableListView.Style>
                                        <Style TargetType="controls:SearchableListView" BasedOn="{StaticResource DefaultListViewStyle}">
                                            <Setter Property="IsVisible" Value="True"/>
                                            <Style.Triggers>
                                                <DataTrigger 
                                                    TargetType="controls:SearchableListView" 
                                                    Binding="{Binding Actions.Count}" 
                                                    Value="0">
                                                    <Setter Property="IsVisible" Value="False"/>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </controls:SearchableListView.Style>
                                    <!-- Grouping -->
                                    <listView:SfListView.DataSource>
                                        <data:DataSource>
                                            <data:DataSource.SortDescriptors>
                                                <data:SortDescriptor PropertyName="Name" Direction="Ascending"/>
                                            </data:DataSource.SortDescriptors>
                                            <data:DataSource.GroupDescriptors>
                                                <data:GroupDescriptor PropertyName="Slug"/>
                                            </data:DataSource.GroupDescriptors>
                                        </data:DataSource>
                                    </listView:SfListView.DataSource>
                                </controls:SearchableListView>
                      </Grid>
            </PullToRefresh:SfPullToRefresh.PullableContent>
</PullToRefresh:SfPullToRefresh>


Thank you,
Andreas

8 Replies 1 reply marked as answer

KK Karthikraja Kalaimani Syncfusion Team March 4, 2021 12:29 PM UTC

Hi Andreas, 

Currently, we are validating your requirement. We will validate and update the details on before March 8th 2021. We appreciate your patience until then. 

Regards,
Karthik Raja


KK Karthikraja Kalaimani Syncfusion Team March 8, 2021 12:32 PM UTC

Hi Andreas,

We have checked the reported issue “RefreshCommand is not triggered when set SfListView’s AllowSwipinga as true” in SfPullToRefresh and SfListView 18.4.0.44 with Xamarin forms versions 4.5.0.617. Unfrotunatley, we couldn’t able to reproduce the issue in our end. We have attached the tested sample for your reference.

Sample link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/ListViewXamarin1511397994.zip


If you still face the issue, could you please modify the provided sample and revert us with its replication procedure. It will be helpful for us to provide you better solution.  

Regards,
Karthik Raja
 



AR Andreas Reitberger replied to Karthikraja Kalaimani March 8, 2021 05:04 PM UTC

Hi Andreas,

We have checked the reported issue “RefreshCommand is not triggered when set SfListView’s AllowSwipinga as true” in SfPullToRefresh and SfListView 18.4.0.44 with Xamarin forms versions 4.5.0.617. Unfrotunatley, we couldn’t able to reproduce the issue in our end. We have attached the tested sample for your reference.

Sample link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/ListViewXamarin1511397994.zip


If you still face the issue, could you please modify the provided sample and revert us with its replication procedure. It will be helpful for us to provide you better solution.  

Regards,
Karthik Raja
 


Hi,
thanks for the update, but I think you did not understand what my issue was. The "RefreshCommand" is triggered, that's not the problem.
The problem is, if you swipe a listviewitem, the pull to refresh also reacts if you swipe a little bit down while you swipe the item right.

So the swipping right of the ListViewItem conflicts with the swipping down for the PullToRefresh control and stops the swipping.

What I did:
- Build it for iOS
- Then try to swipe an item to right, hold down the touch / mouse and move the thumb a little bit down
- See that the pull to refresh reacts and the content gets drawn down.

Using other apps, the pull to refresh control is not reacting when swipping an item.
I also attached a modifed test case.

See this video for reference:
https://drive.google.com/file/d/1aeztoCVFf4-2xjkoqeGv6NzeJPIkvY0h/view?usp=sharing


Attachment: ListViewXamarin_Modified_1f8b67ba.zip


KK Karthikraja Kalaimani Syncfusion Team March 9, 2021 01:10 PM UTC

Hi Andreas,

Thanks for the update.

We saw that the reported issue “Pulling occurs while swiping the lisview item” in your video. Currently, we are validating the issue. We will validate and update the further details on or before 11th March 2021. We appreciate your patience until then.

Regards,
Karthik Raja
 



AR Andreas Reitberger replied to Karthikraja Kalaimani March 9, 2021 04:19 PM UTC

Hi Andreas,

Thanks for the update.

We saw that the reported issue “Pulling occurs while swiping the lisview item” in your video. Currently, we are validating the issue. We will validate and update the further details on or before 11th March 2021. We appreciate your patience until then.

Regards,
Karthik Raja
 


Hi Karthik Raja,

thank you very much. Your help is highly appreciated.


LN Lakshmi Natarajan Syncfusion Team March 10, 2021 11:12 AM UTC

Hi Andreas, 
 
Thank you for your patience. 
 
We have checked the reported query “Pulling occurs while swiping the lisview item” from our side. We would like to inform you that the SfListView supports refreshing the data by loading it directly into the SfPullToRefresh.PullableContent of the SfPullToRefresh. As per the implementation of the ListView, it is recommended to load the SfListView as the first child of the PullableContent. Hence, we suggest to load the SfListView as the directly to the PullableContent to overcome the reported scenario. Please refer to the following code snippets for more reference, 
 
<Grid> 
    <Grid.RowDefinitions> 
        <RowDefinition Height="50"/> 
        <RowDefinition /> 
    </Grid.RowDefinitions> 
    <Label Text="Headline" VerticalTextAlignment="Center"/> 
    <syncfusion1:SfPullToRefresh  
    x:Name="pullToRefresh"  
    RefreshCommand="{Binding RefreshCommand}" 
    IsRefreshing="{Binding IsRefreshing}" 
    TransitionMode="SlideOnTop" 
    PullingThreshold="100" 
    RefreshContentHeight="48" 
    RefreshContentThreshold="48" 
    RefreshContentWidth="48" 
    ProgressStrokeWidth="2" 
    ProgressStrokeColor="Red" 
    ProgressBackgroundColor="WhiteSmoke" > 
        <syncfusion1:SfPullToRefresh.PullableContent> 
            <syncfusion:SfListView  
                Grid.Row="1" 
                x:Name="listView"  
                ItemSpacing="1"   
                AllowSwiping="True" 
                AutoFitMode="Height" 
                FocusBorderThickness="0" 
                IsStickyHeader="True" 
                IsStickyGroupHeader="True" 
                SelectionMode="Single" 
                AllowGroupExpandCollapse="True" 
                SwipeOffset="156" 
                ItemsSource="{Binding Contactsinfo}"> 
                ... 
            </syncfusion:SfListView> 
        </syncfusion1:SfPullToRefresh.PullableContent> 
    </syncfusion1:SfPullToRefresh> 
</Grid> 
 
We have mentioned the same in our user guidance document. Please refer to our user guidance document regarding the same from the following link, 
 
Please let us know if you need further assistance. 
 
Lakshmi Natarajan 
 


Marked as answer

AR Andreas Reitberger replied to Lakshmi Natarajan March 10, 2021 04:32 PM UTC

Hi Andreas, 
 
Thank you for your patience. 
 
We have checked the reported query “Pulling occurs while swiping the lisview item” from our side. We would like to inform you that the SfListView supports refreshing the data by loading it directly into the SfPullToRefresh.PullableContent of the SfPullToRefresh. As per the implementation of the ListView, it is recommended to load the SfListView as the first child of the PullableContent. Hence, we suggest to load the SfListView as the directly to the PullableContent to overcome the reported scenario. Please refer to the following code snippets for more reference, 
 
<Grid> 
    <Grid.RowDefinitions> 
        <RowDefinition Height="50"/> 
        <RowDefinition /> 
    </Grid.RowDefinitions> 
    <Label Text="Headline" VerticalTextAlignment="Center"/> 
    <syncfusion1:SfPullToRefresh  
    x:Name="pullToRefresh"  
    RefreshCommand="{Binding RefreshCommand}" 
    IsRefreshing="{Binding IsRefreshing}" 
    TransitionMode="SlideOnTop" 
    PullingThreshold="100" 
    RefreshContentHeight="48" 
    RefreshContentThreshold="48" 
    RefreshContentWidth="48" 
    ProgressStrokeWidth="2" 
    ProgressStrokeColor="Red" 
    ProgressBackgroundColor="WhiteSmoke" > 
        <syncfusion1:SfPullToRefresh.PullableContent> 
            <syncfusion:SfListView  
                Grid.Row="1" 
                x:Name="listView"  
                ItemSpacing="1"   
                AllowSwiping="True" 
                AutoFitMode="Height" 
                FocusBorderThickness="0" 
                IsStickyHeader="True" 
                IsStickyGroupHeader="True" 
                SelectionMode="Single" 
                AllowGroupExpandCollapse="True" 
                SwipeOffset="156" 
                ItemsSource="{Binding Contactsinfo}"> 
                ... 
            </syncfusion:SfListView> 
        </syncfusion1:SfPullToRefresh.PullableContent> 
    </syncfusion1:SfPullToRefresh> 
</Grid> 
 
We have mentioned the same in our user guidance document. Please refer to our user guidance document regarding the same from the following link, 
 
Please let us know if you need further assistance. 
 
Lakshmi Natarajan 
 


Hi,
Thanks for the update. This did work for me. Thank you!


LN Lakshmi Natarajan Syncfusion Team March 11, 2021 03:56 AM UTC

Hi Andreas, 
 
Thank you for the update. 
  
We are glad that our solution meets your requirement. Please let us know if you need any further update. As always we are happy to help you out. 
 
Lakshmi Natarajan 
 


Loader.
Up arrow icon