Articles in this section
Category / Section

How to edit the ListView tapped item in Xamarin.Forms (SfListView) using DataForm?

1 min read

You can edit the tapped ListViewItem by binding the item to DataForm in Xamarin.Forms ListView.


ListView ItemTemplate defined with Edit button to edit the data.

<ContentPage xmlns:listView="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms">
           <listView:SfListView x:Name="listView" 
                           ItemsSource="{Binding contactsinfo}" >
                                <StackLayout >
                                            <Image Source="{Binding ContactImage}" />
                                            <StackLayout Grid.Column="1">
                                                <Label Text="{Binding ContactName}"/>
                                                <Label Text="{Binding ContactNumber}"/>
                                            <Grid Grid.Column="2">
                                                <Button x:Name="ZoomIn" Text="Edit" Command="{Binding Path=BindingContext.TapCommand, Source={x:Reference Name=listView}}" 
                                            CommandParameter="{Binding .}" />


DataForm defined with TappedItem binding from ViewModel.

    <dataForm:SfDataForm x:Name="dataForm" 
                         LabelPosition="Top" CommitMode="PropertyChanged"
                         DataObject="{Binding TappedItem}"/>
    <Button Text="Done" Command="{Binding DoneCommand}" Grid.Row="1"/>


On edit, Update the edited item to TappedItem property and navigate to DataForm page

public class ContactsViewModel : INotifyPropertyChanged
    private Contacts _tappedItem;
    public Command<object> TapCommand { get; set; }
    public Command<object> DoneCommand { get; set; }
    public Contacts TappedItem
        get => _tappedItem;
        set {
            _tappedItem = value;
    public ContactsViewModel()
        TapCommand = new Command<object>(ButtonTapped);
        DoneCommand = new Command<object>(DoneTapped);
    private void DoneTapped(object obj)
    private void ButtonTapped(object obj)
        TappedItem = obj as Contacts;
        var dataForm = new EditPage();
        dataForm.BindingContext = this;


ListView Items                   DataFormPage

View sample in GitHub



I hope you enjoyed learning about how to edit the ListView tapped item in Xamarin.Forms (SfListView) using DataForm.

You can refer to our Xamarin.Forms ListView feature tour page to know about its other groundbreaking feature representations. You can also explore our Xamarin.Forms ListView documentation to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied