How to show an item default selected in listview?

1k Views Asked by At

I have a list of items. First I select an item from list then save it in local db. Now I want that when user open app next time. The save item should be default selected in the list. But no item is selecting default when user comes next time.

How is it possible in xamarin.forms to select an item default selected in listview?

1

There are 1 best solutions below

0
On

You can set the Listview Selected Item in your code behind.

Assuming you have Binded your ItemsSource, you just need to get the object you want to set as selected and do this:

ListviewItems.SelectedItem = YourCollection[YourIndex];