Back to Devexpress

DxTreeViewNode.UrlMatchMode Property

blazor-devexpress-dot-blazor-dot-dxtreeviewnode-d5212892.md

latest2.8 KB
Original Source

DxTreeViewNode.UrlMatchMode Property

Specifies whether the item becomes selected if its DxTreeViewNode.NavigateUrl property value matches the active web page. If the control does select the item, it expands all parent items.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(null)]
[Parameter]
public NavigationUrlMatchMode? UrlMatchMode { get; set; }

Property Value

TypeDefaultDescription
Nullable<NavigationUrlMatchMode>null

A NavigationUrlMatchMode enumeration value.

|

Available values:

NameDescription
None

Automatic selection synchronization is disabled.

| | CurrentPath |

The component selects an item if the item’s NavigateUrl property value matches the current browser URL. The query string appended to the URL is ignored.

| | Prefix |

The component selects an item if the item’s NavigateUrl property value starts with the current browser URL and vice versa.

| | Exact |

The component selects an item if the item’s NavigateUrl property value matches the current browser URL.

|

Remarks

Use a node’s UrlMatchMode property to specify whether the TreeView selects this node if its NavigateUrl property matches the current browser URL. If you do not specify the item’s UrlMatchMode property, the Accordion uses its own UrlMatchMode property value.

The following example sets the first item’s UrlMatchMode to Exact to select the Overview page only when it is active:

razor
<DxTreeView AllowSelectNodes="true" UrlMatchMode="NavigationUrlMatchMode.Prefix" CssClass="app-sidebar">
    <Nodes>
        <DxTreeViewNode NavigateUrl="./" Text="Overview" UrlMatchMode="NavigationUrlMatchMode.Exact"></DxTreeViewNode>
        <DxTreeViewNode NavigateUrl="grid" Text="Grid">
    </Nodes>
</DxTreeView>
razor
@page "/grid/selection"

<h3>Selection</h3>

See Also

DxTreeViewNode Class

DxTreeViewNode Members

DevExpress.Blazor Namespace