我有一個應用程序,利用PropertyGrid中的在C#/。NETC#的PropertyGrid上列表限制編輯<T>項
的PropertGrid
保持到如下所示的MyAppObject
類/對象..
class MyAppObject
{
private List<MyObject> oItems;
public List<MyObject> Items
{
get { return this.oItems; }
}
}
到目前爲止,它運行良好,很好,很簡單。我希望屬性網格允許用戶查看項目,但是當您在PropertyGrid中選擇屬性時,該對話框還允許添加更多List<MyObject> items
。
我不想這樣,我只想有能力顯示項目,而不是編輯它們。
我想通過不提供的setter(set { this.oItems = value; }
):
然後它wouldnt允許添加按鈕。
希望這是有道理的,屏幕截圖顯示對話框,我圈出了我想要刪除的按鈕。
感謝