How to get buttons that expand/collapse all with dropdown tree

With the dropdown tree control, you can have a 'HeaderTemplate' so in there I could put some buttons to expand/collapse all nodes of the tree.

How do you wire up said buttons to make that work? I've tried pointing to a property to bind to expanded in DropDownTreeField, but setting that to true on all nodes doesn't result in any change/update to the tree, even with a 'StateHasChanged' or a call to 'RefreshAsync' on the tree.

The control doesn't seem to expose the underlying 'ExpandAll', 'CollapseAll' methods of the underlying tree.


3 Replies

SJ Saravanan Jayavel Syncfusion Team June 26, 2025 04:25 AM UTC

Hi Matthew Paul,


Greetings from Syncfusion support.


Based on the details you've shared, we understand that you are looking for an option to programmatically expand and collapse all the tree node in the Blazor Dropdown Tree. Currently, we don’t have a direct option to meet your need. However, we would like to inform you that we have considered this a feature request on our end. This feature will be included in one of our upcoming releases. Typically, we prioritize features based on customer demand, feature ranking, and wish list plans.


You can track the status of this feature using the link below:


Feedback: https://www.syncfusion.com/feedback/64836/provide-an-option-to-programmatically-customize-the-expand-and-collapse-actions-of


Check out the shared details and let us know is you need any further assistance.


Regards,

Saravanan J



SR Sophie Raymond June 26, 2025 08:09 AM UTC

Great observation—this seems to be a limitation of the abstraction around the DropDownTree control. If the control doesn't expose ExpandAll or CollapseAll directly, one workaround might be to reference the underlying TreeView component (if accessible) via a @ref and trigger the methods from there. Otherwise, if binding to the Expanded property on nodes isn't updating the UI, it suggests internal state isn't Space Waves syncing properly or reacting to changes.



SJ Saravanan Jayavel Syncfusion Team June 27, 2025 02:16 PM UTC

Hi Sophie Raymond,


Thank you for your valuable observations regarding the Dropdown Tree control. We'll take this suggestion into account and explore its feasibility during our feature planning. However, as mentioned earlier, we are currently unable to provide a specific timeline for implementation. We prioritize features based on overall demand, feature ranking, and wish list plans.


Kindly track the status of this request through our feature feedback portal.


Regards,

Saravanan J


Loader.
Up arrow icon