Forum General

Can't bind parameter using join clause

dave_silvadave_silva Member ✭✭
edited September 2020 in General

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
TextColor="#000000" />

But nothing shows. Any idea ? If I bind the Id_Client it shows the correct Id...


  • dave_silvadave_silva Member ✭✭

    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 ?

Sign In or Register to comment.