【发布时间】:2021-06-28 13:39:45
【问题描述】:
为了简化我的情况,基本上,我有以下从数据库中读取类型的类:
public class Type1
{
public int Property1 { get; set; }
public int Property2 { get; set; }
}
public class Type2
{
public int Property3 { get; set; }
public int Property4 { get; set; }
}
public class Info
{
public Type1 Type1 { get; set; }
public Type2 Type2 { get; set; }
}
我想做的是使用 Info 类在 DataGrid 中显示每个 Type 属性的名称和值。我应该选择什么方法来做到这一点?
我的想法是从 Info 类创建一个 DataTable 并将其用作 DataGrid 的输入。这会是最好的方法吗?
【问题讨论】:
-
你能解释一下结果应该是什么样子吗?
-
当然!结果表应具有以下列:Property1、Property2、Property3、Property4
标签: c# uwp datatable windows-community-toolkit