我有一个Employee类。数据库中有许多部门维护,一名雇员可能只属于一个特定的部门。PropertyGrid C中的列表#
public class Employee
{
private string name;
private int depID;
public string Name
{
get { return name; }
set { name = value; }
}
public int DepartmentID
{
get { return depID; }
set { depID = value; }
}
}
public class Department
{
private int depID;
private string depName;
public int DepartmentID
{
get { return depID; }
}
public int DepartmentName
{
get { return depName; }
set { depName = value; }
}
}
如何在部件PropertyGrid中显示对象Employee作为将显示为组合框的属性之一?
可能吗?还是有更好的实施? 预先感谢您的意见。
当你说*任何更好的实现*,你的意思是,你可能放弃PropertyGrid中做到这一点? PropertyGrid中的组合框并不像看起来那么简单,所以任何其他解决方案都不会更糟。 –