Is there a way to conditionally collapse a category in the xamPropertyGrid at runtime?
Regards,
Arthur
Hello Arthur,
Thank you for your post.
I have created a short project in order to show you how you can achieve the functionality you are looking for. Basically in the sample application I created style for PropertyGridCategoryItemView in the resources of XamPropertyGrid and handled its Loaded event in EventSetter. In the event handler of Loaded event I got the Category I want by the DisplayName property of PropertyGridCategoryItemView. Then I get its ToggleButton from the visual tree by using GetDescendantFromType method of our Utilities class and set its IsChecked property to false in order to Collapse the category. Please take a look at the attached sample application and let me know if I am missing something from your scenario.
Please let me know if you require any further assistance in the matter I will be glad to help.
Thank you, this worked well.