c# - Xceed 属性网格 : Collection Editor Not Expanding In Proper Manner

标签 c# wpf propertygrid xceed collectioneditor

我使用过 Xceed Property Grid。我在这个 Property Grid 中使用了 Xceed 的 Collection Editor for Collections。

[Editor(typeof(CustomCollectionEditor), typeof(CustomCollectionEditor))]
[Serializable]
public class Variable
{
//Properties in Class
}

此处自定义集合编辑器派生自 Xceed 集合编辑器。但是什么都没有被覆盖。它只是一个包装类。

Xceed 网站讲述了以下扩展过程: “PropertyGrid 支持这种情况,并允许您深入了解属性的层次结构。要启用这种行为,您必须使用 ExpandableObject 属性装饰您的属性”

所以我在我的属性(property)中使用它作为:

[ExpandableObject]
public List<Variable> GlobalVariableList
{
  get { return _varlist; }
  set { _varlist = value; }
}

但是Expanding this中只显示了Properties的Count。而不是属性名称和值。

最佳答案

我认为您的 customcollectioneditor 需要在集合而不是项目上。

关于c# - Xceed 属性网格 : Collection Editor Not Expanding In Proper Manner,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31477116/

相关文章:

vb.net - 如何使用表单中的属性网格来编辑任何类型

c# - UCMA 应用程序中的 ApplicationEndPoint

c# - 在 Windows 上开发但在 Linux 上运行的 ASP.NET 5

c# - 创建包含 ResourceDictionary 的 DLL

.net - WinForms 到 WPF - 我们如何从这里到达那里?

c# - 如何在 PropertyGrid 自定义集合编辑器中自定义 "Add"按钮下拉列表中的名称

javascript - 使用WCF Rest进行跨域调用时出错

c# - 从 TabItem 获取并迭代控件?

c# - 如何创建类似于 Google Images 的 WPF 布局

c# - PropertyGrid 能否为不同的选定对象值自定义显示,而不是空白?