Forum Xamarin.Forms

ItemTapped event for programmatically created ListView

Why ItemTapped event doesn't exist in programmatically created ListView? ItemTapped& ItemSelectedevent exist for ListView designed using Xaml, but how to declare ItemTapped event for ListView created using C#? As far as i saw, i didn't find any event for finding ItemTap on ListView, or i didn't check properly? I saw only SelectedItem property for ListView.

Answers

  • nikhil.8479nikhil.8479 USMember

    you can use the ListView's ItemTapped Event as:

    //ListView myList

    myList.ItemTapped+=(object sender, ItemTappedEventArgs args) =>
    {
    DisplayAlert("Selected Item",args.Item.ToString(),"OK");
    };

Sign In or Register to comment.