Forum Xamarin.Forms

Read TextCell Binding from ListView

How can i read text in listview



Output :

I've tried it, use i ListMK_ItemSelected

private void ListMK_ItemSelected(object sender, SelectedItemChangedEventArgs e)
string item = e.SelectedItem.ToString();
DisplayAlert("ItemSelected", item, "Ok");

When selected output :

i wanna output like this :


Help, Thanks Before...


  • JohnHJohnH GBMember ✭✭✭✭✭
    edited September 2019
    SelectedItem is the model of the row you selected. So cast as the model, then you can access the properties.
  • JarvanJarvan Member, Xamarin Team Xamurai

    Get the model by the selectedItem in itemSelected event, then display the NAMA_MK info in popup.

    private void Listview_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        var model = e.SelectedItem as ListViewModel;
        DisplayAlert("ItemSelected", model.NAMA_MK, "Ok");
  • JarvanJarvan Member, Xamarin Team Xamurai
    edited September 2019

    Have you solved the problem? If you are facing some issues while implementing, try to post the particular error with the corresponding codes here.

Sign In or Register to comment.