【发布时间】:2017-01-30 21:12:01
【问题描述】:
我有两个班级:
public class Contact{
public string contact { get; set; }
public string contact_type { get; set; }
}
public class Person{
public string first_name { get; set; }
public string last_name { get; set; }
Contact phone
}
在我的 asp.net 应用程序中,我需要在 gridview 中查看人员列表。 我使用 ObjectDataSource 来绑定 List。但只有两列:first_name 和 last_name 出现在 gridview 中。看人的联系方式的重要。 换句话说,如何将子类Contact 绑定到同一个gridview。 做这个的最好方式是什么?我不喜欢使用 DataTable 的想法。 谢谢!
【问题讨论】:
-
您希望联系人字段在网格视图中显示为单独的列吗?
标签: asp.net gridview data-binding