在PropertyGrid中排序属性 [英] Ordering properties in a PropertyGrid
问题描述
我在C#中使用PropertyGrid来显示ConfigurationElements.我有一个ExpandableObjectConverter TypeConverter的实现,以在属性网格中显示子元素(带有描述).
例如
I''m using a PropertyGrid in C# to display ConfigurationElements. I have an implementation of a ExpandableObjectConverter TypeConverter to display the sub-elements (with descriptions) in the property grid.
E.g.
Item 1
First sub-item
Item 1 ID
Second sub-item
x
Item 2
First sub-item
Item 2 ID
Second sub-item
x
...
我想按特定顺序显示子元素-而不是按字母顺序显示(例如,其他子元素之前的ID).
有人可以告诉我如何指定顺序吗? (我用Google搜索它,看过CodeProject文章,看过MSDN-在那儿(瞬间)我以为我发现了使用SortProperties的解决方案-事实证明这不是可替代的.)
任何想法都将不胜感激.
I want to display the sub-elements in a specific order - not alphabetically (e.g. The ID before the other sub-elements).
Could anyone please tell me how to specify the ordering? (I''ve Googled it, looked at CodeProject articles, looked on MSDN - where I (momentarily) thought I''d found a solution using SortProperties - which turns out not to be overridable.)
Any ideas would be much appreciated.
推荐答案
任何想法都会非常感谢.
Any ideas would be much appreciated.
是否可以选择覆盖 GetProperties [
Would it be an option to override the GetProperties[^] method?
这篇关于在PropertyGrid中排序属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!