This is a migrated thread and some comments may be shown as answers.

Want to add Swipe in single direction with multiple columns

2 Answers 162 Views
ListView
This is a migrated thread and some comments may be shown as answers.
amit
Top achievements
Rank 1
amit asked on 09 Aug 2017, 12:52 PM

Hi,

 

I am trying to create swipe functionality in listview, The challenge is I have to add 3 columns in left swipe. right now what is happening that I am getting one column on right side and one columns in left side. Please help

 

Regards,

Amit

2 Answers, 1 is accepted

Sort by
0
Ganesh
Top achievements
Rank 1
answered on 10 Aug 2017, 11:45 AM

Hi Amit,

 

You can use the Property of Offset to change the directions of swipe on listview Item.

Below is the example code

 <telerikDataControls:RadListView  x:Name="listView"
                                         SelectionMode="Multiple"
                                         ItemsSource="{Binding Items}"
                                         IsItemSwipeEnabled="True" SwipeOffset="0,0,150,0">

          <telerikDataControls:RadListView.ItemSwipeContentTemplate>
                <DataTemplate>
                    <Grid ColumnSpacing="0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>

                             <ColumnDefinition Width="Auto"/>

                        </Grid.ColumnDefinitions>
                        <Grid BackgroundColor="Green" Grid.Column="1">
                            <Button Text="Approve" Image="approve.png" Clicked="OnApprove"
                                    ContentLayout="Top"  HorizontalOptions="CenterAndExpand"/>
                        </Grid>
                        <Grid BackgroundColor="Red" Grid.Column="2">
                            <Button Text="Reject" Image="reject.png" Clicked="OnReject" 
                                    ContentLayout="Top" HorizontalOptions="CenterAndExpand"/>
                        </Grid>
                    </Grid>
                </DataTemplate>
            </telerikDataControls:RadListView.ItemSwipeContentTemplate>

</telerikDataControls:RadListView>

0
Stefan Nenchev
Telerik team
answered on 14 Aug 2017, 08:21 AM
Hi Amit,

As Ganesh suggested, working with the SwipeOffset in combination with a proper ItemSwipeContentTemplate should be helpful in your situation. Please give it a try and update the thread whether this helped. Otherwise, sharing more information on your scenario will be appreciated.

Regards,
Stefan Nenchev
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ListView
Asked by
amit
Top achievements
Rank 1
Answers by
Ganesh
Top achievements
Rank 1
Stefan Nenchev
Telerik team
Share this question
or