Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxTreeView.CollapseAll() Method

In This Article

Collapses all nodes in the DxTreeView.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public void CollapseAll()

#Remarks

Use the ExpandAll() and CollapseAll methods to expand and collapse all nodes in the DxTreeView.

The following code snippet implements the Expand all and Collapse all buttons.

Razor
<button type="button" @onclick="@(() => SampleTreeView.ExpandAll())">Expand all</button>
<button type="button" @onclick="@(() => SampleTreeView.CollapseAll())">Collapse all</button>

<DxTreeView @ref="@SampleTreeView">
    ...
</DxTreeView>    

@code  {
    DxTreeView SampleTreeView;
    ...
See Also