当对象的属性是一个自定义对象时,怎么绑定?
情景:
Parent/Child,child对象中包含一个Parent的属性,如下
public class Parent
{
Name,
ID,
...
}
public class Child
{
Name,
ID,
...
private Parent myParent
public Parent MyParent
{
get{return myParent;}
set{myParent = value;}
}
...
}
把某一个Child列表绑定到GridView或是其他数据控件上,希望在空间上看到Parent的Name,如何绑定。