Enhance behaviour of Drag and Drop

Hello,
I have implemented the drag and drop functionality in SfListView. And it works like charm on Android, iOS and UWP platforms.
But to perform drag and drop in the list view, the client need to long press on the item and then it will enable the DragItemTemplate then he can move the item in list.
Is there any possible way by which we can directly allow the user to drag and drop the list item without showing the DragItemTemplate then move?

1 Reply

RS Rawoof Sharief Muthuja Sherif Syncfusion Team April 16, 2018 12:00 PM UTC

Hi Hetal, 
 
We have checked the reported query “Drag and item without holding” from our end. We would like to let you know that the ItemDrag and drop has three value. It can be enabled by setting the SfListView.DragStartMode property to OnDragIndicator. The drag and drop options are listed as follows: 
  • None: Disables drag and drop. This is the default value.
  • OnHold: Allows dragging and dropping by holding the item.
  • OnDragIndicator: Allows dragging and dropping by loading the DragIndicatorView within SfListView.ItemTemplate.
 
We have already documented this, so please find the documentation link below. 
 
 
To drag and drop the items by DragIndicatorView, set the SfListView.DragStartMode property to OnDragIndicator. To display the dragging item, define any custom user interface(UI) in DragIndicatorView like below code snippet. 
 
Code Example[XAML]:   
 
 <syncfusion:SfListView x:Name="listView" Grid.Row="1" 
                           ItemSize="60" 
                           ItemsSource="{Binding ToDoList}" 
                           DragStartMode="OnHold,OnDragIndicator"> 
<syncfusion:SfListView.ItemTemplate> 
        <DataTemplate> 
            <syncfusion:DragIndicatorView Grid.Column="2" ListView="{x:Reference listView}" HorizontalOptions="Center" VerticalOptions="Center"> 
               <Grid Padding="10, 20, 20, 20"> 
                 <Image Source="DragIndicator.png" VerticalOptions="Center" HorizontalOptions="Center"/> 
              </Grid> 
            </syncfusion:DragIndicatorView> 
        </DataTemplate> 
      </syncfusion:SfListView.ItemTemplate> 
 
Please let us know if you require further assistance. 
 
Regards, 
Rawoof M. 


Loader.
Up arrow icon