PropertyGrid sort-order of categories given via attributes

Posted 24 days ago by Avatar matt2012


I update from a older version to 2017.2.
I use the propertygrid.
In the old version I define categories via attributes. I localize the strings via own classes inherit from CategoryAttribute.
On the attributes I also give a sort-order of the category.
[LocalizedCategorySortOrder("MasterCat_1\\SubCat_X", 2)]

In the new version I didn't find a way to access the given sort-priorities.

Is there a possibility?
Thanks in advance.

Information The latest build of this product (2018.1 build 0672) was released 27 days ago, which was before this thread was created.

Comments (2)

Posted 24 days ago by Actipro Software Support - Cleveland, OH, USA


Sorry I'm not sure how what you're describing worked before since LocalizedCategorySortOrder is your own custom attrribute class.

That being said, in the newer PropertyGrid control, we support sorting via numerous extension points.  Programmatic sorting can be achieved by updating logic described in the "Categorization and Sorting" documentation topic.  Or you could go with a simple attribute to sort as well:

[Display(Order = 2)]

We examine that Order value in DisplayAttribute for our default logic.

Actipro Software Support
Posted 21 days ago by matt2012


thanks for your answer.
I've solved my problem by using the GetCustomAttributes-function inside the overridden GetPropertyModels-function. Here I built my index for the categories.
This index will used in the overriden GetDataModels-function.


Add a Comment

Please log in to a validated account to post comments.