PropertyGrid sort-order of categories given via attributes

Grids for WPF Forum

Posted 6 years ago by matt2012
Version: 17.2.0665


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.

Comments (2)

Answer - Posted 6 years 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 6 years 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.


The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.