ExpandableCollectionConverter

Grids for WPF Forum

Posted 13 years ago by Marcel Konnegen
Avatar
Hello Support,
we use an ExpandableCollectionConverter to display and edit a ChildCollection (where each child is an ExpandleObjectConverter). The integrated editor displays correctly inside the PropertyGrid, and we can successfully add and remove items. The question is, if there is also a way to reorder the items?

Thank you for your help!

With regards
Konnegen

[Modified at 10/20/2010 07:18 AM]

Comments (4)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Marcel,

By default, things are sorted by name. You can disable this by setting PropertyGrid.AreDefaultSortDescriptionsEnabled to false. Then you can use PropertyGrid.SortComparer to implement your own sorting logic. The Sorting QuickStart shows an example of how this is done.

If your collection is not already sorted in the order you'd like it displayed in, you can sort them in your custom SortComparer. Your SortComparer would have to handle all the sorting though, including categories and properties.

Alternatively, you could create a class that derives from ExpandableCollectionConverter and overrides the GetProperties method. Next you'd call the base class method and then sort the results before returning the list of properties. Finally, you'd use your custom converter in place of ours.


Actipro Software Support

Posted 13 years ago by Marcel Konnegen
Avatar
Hello Support,
we actiolly already have a class, that derives from ExpandableCollectionConverter. What I really meant was not sorting the items of a collection but reordering them during runtime via an Editor. The adding and removing is already handled by your build-in editor, so we were wondering if there is also support for reordering Items. To give you some Context...we have a TabControl where the single Tabs are stored in an IList. Adding and removing Tabs via the Propertygrid is already supported by ActiPro. Is it also possible or will it be posible in the future to reorder the Tabs -> meaning changing their index inside the IList.

Thank you for your help.

With regards,
Marcel Konnegen
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Marcel,

That is not currently supported by default. I've marked down a TODO item to see about adding that feature in the future.


Actipro Software Support

Posted 13 years ago by Marcel Konnegen
Avatar
Hello Support,
thank you!

With regards,
Marcel Konnegen
The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.