Keep subelements open, when changing displayed element

Grids for WPF Forum

Posted 7 years ago by Caer_dalben
Version: 12.2.0570
Avatar

I am currently evaluating your WPF PropertyGrid.

In my application the user changes the displayed element frequently, for example to compare two items. In your sampleapplication, the subelements (those defined with an ExpandableObjectConverter) will always close whenever the SelectedObject is changed, even if the classtype of the 2 elements remains the same. Is there an easy solution to change that behaviour in a way that open subelements stay open and closed ones stay closed?

Greetings,

Comments (1)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi and thank you for evaluating PropertyGrid.

I'm sorry but if you switch the SelectedObject then everything within refreshes, meaning you will lose the expansion state.  Since PropertyGrid inherits TreeView, perhaps when you know this situation is going to occur you could recurse down the tree items and save expansion states.  Then once the new selected object is displayed, restore those expansion states.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) 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.