Back to Devexpress

DxAccordion.UrlMatchMode Property

blazor-devexpress-dot-blazor-dot-dxaccordion-52f4c0cf.md

latest3.1 KB
Original Source

DxAccordion.UrlMatchMode Property

Specifies whether the item becomes selected if its 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(NavigationUrlMatchMode.None)]
[Parameter]
public NavigationUrlMatchMode UrlMatchMode { get; set; }

Property Value

TypeDefaultDescription
NavigationUrlMatchModeNone

An 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

The component can automatically select and expand to an item based on the item’s NavigateUrl property value and the current browser URL. Use the UrlMatchMode property and set the SelectionMode property value to Single to enable this functionality.

In the following example, the Accordion selects an item if the NavigateUrl property value matches the current page’s address:

razor
<div class="p-2">
    <DxAccordion UrlMatchMode="NavigationUrlMatchMode.Exact" 
                 SelectionMode="NavigationSelectionMode.Single">
        <Items>
            <DxAccordionItem Text="Shapes" NavigateUrl="shapes">
                <Items>
                    <DxAccordionItem Text="Circle" />
                    <DxAccordionItem Text="Square" />
                </Items>
            </DxAccordionItem>
            <DxAccordionItem Text="Templates" />
        </Items>
    </DxAccordion>
</div>

You can also use the DxAccordionItem.UrlMatchMode property to specify this option for individual items.

View Example: Use the Accordion to organize navigation in the application

See Also

DxAccordion Class

DxAccordion Members

DevExpress.Blazor Namespace