Question

Expand All / Collapse All command

Posted 5 months ago by Avatar rex hui

I just realized that there is keyboard shortcut Ctrl+* and Ctrl+/ to perform an expand all and collapse all of all items.

Are those two functions available to be call from the code?

I have added two buttons "expand all" and "collapse all" to the propertygrid dialog and I want to able to perform those two functions.

Thanks.


Comments (3)

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

Hi Rex,

We don't have a public method for that functionality other than overriding the ProcessKeyDown method and passing it some mocked up KeyEventArgs.  Really the best way to expand all  is to recurse down your view-model tree and set each model's IsExpanded flag along the way.  The problem with expand all functionality is that for large trees that have time-consuming load times, expand all can be a blocking operation.  That's why manually recursing your tree and expanding view-models allows you to pick and choose which nodes to expand and how deep you want to go.  On the other hand, if your tree isn't very large or is fully-loaded in memory from the start, easy built-in programmatic expand all functionality might be nice.  Would you still like us to add public methods for what we call with the "Ctrl+*" and "Ctrl+/" keys?


Actipro Software Support
Posted 5 months ago by rex hui

I think it would be nice to include those as public methods since they are available through shortcut keys.

Thank you very much!

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

Hi Rex,

Ok we will add ExpandAll and CollapseAll methods in the next build.


Actipro Software Support
Information The latest build of this product (2018.1 build 0673) was released 1 month ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.