【问题标题】:Modify data beafore binding in Xamarin Forms在 Xamarin Forms 中绑定之前修改数据
【发布时间】:2021-12-17 21:18:06
【问题描述】:

我是 Xamarin Forms 的新手。我正在从我的 Web 服务器数据库将数据绑定到 ListView。我的网络服务器中有 2 个表。

  1. Tb_Country
  2. Tb_Region

Tb_Region 表中有一个 country_id 列。我在我的 ListView 中显示区域列表。但我得到的只是 country_id。我还想显示 Tb_Country 的国家名称。 我该怎么做?

【问题讨论】:

  • 请在发帖前阅读How to Ask。为了让我们帮助您,我们必须知道您在做什么,并且您还没有发布任何相关代码

标签: android rest xamarin xamarin.forms


【解决方案1】:

也许您需要 ListView 中的 DataTemplate?

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

source

【讨论】:

    猜你喜欢
    • 2016-11-24
    • 2018-03-13
    • 2012-10-09
    • 1970-01-01
    • 2021-02-20
    • 2019-11-02
    • 2018-03-09
    • 1970-01-01
    • 2022-09-29
    相关资源
    最近更新 更多