I'm doing a cross platform app using Xamarin. I want to bind a ListView with a query.
My query looks like this :
public async Task<List<Meeting>> GetAllMeetings() { return await _database.QueryAsync<Meeting>("Select Client.Prenom,Meeting.Id_Client, Meeting.DateRDV, Meeting.HourRDV,Meeting.TypePose,Meeting.IsStudent from 'Meeting' JOIN 'Client' on Meeting.Id_Client = Client.Id"); }
In my ListView I'm able to bind every parameter, except Client.Prenom. I've tried only writing Prenom but nothing shows.
Here's how I bind :
listViewAllMeetings.ItemsSource = await App.Database.GetAllMeetings(); List<Meeting> list = listViewAllMeetings.ItemsSource as List<Meeting>;
And in the xaml file I do like this to bind Prenom:
<Label Text="{Binding Prenom}" //also tried Client.Prenom HorizontalOptions="Start" TextColor="#000000" />
But nothing shows. Any idea ? If I bind the Id_Client it shows the correct Id...
Answers
After checking some breakpoints, my List list doesnt contain a field Prenom, only have the fields of a Meeting object, so that's the reason I can display Id_Client and not Prenom, any idea on how to fix it ?