TreeViewNodeCancelEventArgs.Cancel Property
In This Article
Specifies whether the action that raised the event should be canceled.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
#Declaration
C#
public bool Cancel { get; set; }
#Property Value
Type | Description |
---|---|
Boolean |
|
#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