我有一個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中的組合框並不像看起來那麼簡單,所以任何其他解決方案都不會更糟。 –