0
如何在DataGrid中顯示Person對象的集合,以便還可以查看有關Person,Address,Dependents和Awards的信息。在WPF中顯示嵌套數據
public class Person
{
public int PersonId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
public Address Address { get; set; }
public IList<Dependent> Dependents { get; set; }
public IList<Award> Awards { get; set; }
}
public class Address
{
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
}
public class Dependent
{
public string DependentName { get; set; }
public int DependentAge { get; set; }
}
public class Award
{
public string AwardName { get; set; }
public DateTime AwardDate { get; set; }
}
那你試試? – makc
我試過/嘗試HierarchicalDataTemplate,沒有成功。 – Brij