简体   繁体   中英

Modify data beafore binding in Xamarin Forms

I am new at Xamarin Forms. I am binding data to ListView from my Web Server data base. I have 2 table in my web server.

  1. Tb_Country
  2. Tb_Region

There is a column country_id in the Tb_Region table. I am displaying region list in my ListView. But I am getting only country_id. I want to display also country title from Tb_Country. How can I do that?

Maybe you need a DataTemplate in the ListView?

<ListView x:Name="EmployeeView"
        ItemsSource="{Binding Employees}">
<ListView.ItemTemplate>
  <DataTemplate>
    <TextCell Text="{Binding DisplayName}" />
  </DataTemplate>
</ListView.ItemTemplate>

source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM