Hallo,
I have a small app in Xamarin for Andrios and IOS in c#. A list is displayed there via a list view. Itemsource is an ObservableCollection that is used to load data from a local database (SQLite). These data can be filtered by the user using various functions. Everything is working well.
Now I want to loop through and process the data displayed in the ListView. To do this, I need the "ID" field in the list view of every displayed data record. I can't find a solution online. This is also possible in other environments such as VB.NET.
I have tried it this way and that.
ObservableCollection<Classes.jGeraete> result = new ObservableCollection<Classes.jGeraete>();
result = (ObservableCollection<Classes.jGeraete>)myList.ItemsSource;
foreach (var item in result.ToList())
{
DisplayAlert("Meldung", item.ID.ToString(), "ok");
}
Can someone help me?
Thanks Michael