Back to Devexpress

TreeViewNodeCancelEventArgs.Cancel Property

blazor-devexpress-dot-blazor-dot-treeviewnodecanceleventargs.md

latest1.1 KB
Original Source

TreeViewNodeCancelEventArgs.Cancel Property

Specifies whether the action that raised the event should be canceled.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public bool Cancel { get; set; }

Property Value

TypeDescription
Boolean

true, if the action that raised the event should be canceled; otherwise, false.

|

Remarks

The following code snippet prohibits root-level nodes from collapsing.

razor
<DxTreeView BeforeCollapse="@BeforeCollapse">
    ...
</DxTreeView>

@code {
    void BeforeCollapse(TreeViewNodeCancelEventArgs e) {
        if (e.NodeInfo.Level == 0) e.Cancel = true; 
    }
}

See Also

TreeViewNodeCancelEventArgs Class

TreeViewNodeCancelEventArgs Members

DevExpress.Blazor Namespace