本文介绍了在PropertyGrid中对多个objets的属性进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 嗨专家, 我正在处理的应用程序的核心部分是用户可以选择多个对象并更改其属性值的位置。用户界面的用户界面是 PropertyGrid [ ^ ]。 这些对象存在于继承层中,有些是彼此的兄弟姐妹。有些由可以发布可编辑属性的其他对象组成。这些子对象的UI是使用 DockPanelSuite 以类似TabControl的方式排列的其他PropertyGrids [ ^ ]。 用户应选择多个对象,它们合并为一个网格。因此设置一个值会影响所有选定的对象(不同的值会导致值空间保持为空,就像我们从VS中知道的那样)。 子对象多选对象的数据与等于类型的子对象合并(在应用程序的意义上,不是在System.Type中的类型)。但是根据应用程序中的功能,它们被分成几个网格。 通过实现 ICustomTypeDescriptor [ ^ ]。事实上,它们都继承自TranslatableBase基类。 非数字值也由自定义TypeConverter [ ^ ] s。 这已经太久了,我担心。 现在我的问题:在每个PropertyGrid中,字母排序不起作用。 显示的属性序列不是按字母顺序排列的,也不是与源中定义的属性相同。 排序与属性名称(翻译前)不匹配。 [/编辑] 拥有 PropertySort [ ^ ] property设置为按字母排序 [ ^ ]适用于单个选定对象,但不适用于多个 - 选择。 [/ Edit2] 是否有必须遵守的内容以便排序有效?Hi experts,the central part of an application I'm working on is where User can select multiple objects and change some of their properties' values. The UI for that is a PropertyGrid[^].The objects live in an inheritance hirarchy, some being siblings of each other. Some are composed of other objects that can publish editable properties as well. Those sub-objects' UI are other PropertyGrids arranged in a TabControl-like manner using DockPanelSuite[^].Should User select multiple objects, they are merged into one grid. So setting one value affects all selected objects (and differing values cause the value space to be left empty, just as we all know it from VS).Sub-objects of multi-selected objects get merged with sub-objects of equalling type (in the sense of the application, not type as in System.Type). But they are separated into several grids as per their function within the application suggests.Property names are nicely translated for foreign users by the objects implementing ICustomTypeDescriptor[^]. In fact, they all inherit from a "TranslatableBase" base class.Non-numeric values are also translated by custom TypeConverter[^]s.This has already gotten far too long, I fear.Now my problem: Within each PropertyGrid, the alphabetical sorting doesn't work.The sequence of properties as displayed is not alphabetical, nor the same as properties are defined in source.The sorting doesn't match the property names (before the translation) either.[/Edit]Having the PropertySort[^] property set to Alphabetical[^] works for a single selected object, but not for multi-selection.[/Edit2]Is there something one has to adhere to so that sorting works?推荐答案 这篇关于在PropertyGrid中对多个objets的属性进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-26 20:42