How to raise ItemSelected event of listview programatically?

Azazel2098 21 Reputation points
2021-12-28T11:15:34.103+00:00

I am relatively new to Xamarin Forms! I wanted to know if there is any way we can raise listview itemselected event through code and not through user selection?

I get a value from messaging center through receiver and want to validate it with existing data in listview. If the selected item matches it should be assigned to a variable for use and also check the check box in the listview.

Developer technologies | .NET | Xamarin
{count} votes

Accepted answer
  1. Michael Taylor 60,161 Reputation points
    2021-12-28T16:51:44.94+00:00

    ItemSelected is triggered when the user selects an item. To do this programmatically find the item and then set the list view's SelectedItem property to it. That should trigger the event.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.