Question

PropertyGrid sort-order of categories given via attributes

Posted 5 months ago by Avatar matt2012

Hello,

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.
Example:
[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)

Posted 5 months ago by Actipro Software Support - Cleveland, OH, USA

Hello,

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 5 months ago by matt2012

Hello,

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.

Regards

Information The latest build of this product (2018.1 build 0674) was released 5 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.