Skip to main content

NavigationItemStateChangeReason Enum

Lists values that specify why the item’s expand or selection state changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public enum NavigationItemStateChangeReason

Members

Name Description
ApiCall

The state changes programmatically.

UserAction

The state changes by user action.

UrlMatch

The state changes as a result of URL matching.

Related API Members

The following properties accept/return NavigationItemStateChangeReason values:

Remarks

In the following example, the Accordion component selects the collapsed item if a user collapses an item whose child item was selected:

<DxAccordion @ref="@MyAccordion" 
             SelectionMode="NavigationSelectionMode.Single"
             AfterCollapse="@AfterCollapse" 
             ExpandCollapseAction="AccordionExpandCollapseAction.ExpandButtonClick">
    <Items>
        <DxAccordionItem Text="Shapes">
            <Items>
                <DxAccordionItem Text="Circle" />
                <DxAccordionItem Text="Square" />
            </Items>
        </DxAccordionItem>
        <DxAccordionItem Text="Templates" />
    </Items>
</DxAccordion>

@code {
    DxAccordion MyAccordion;
        void AfterCollapse(AccordionItemStateChangeEventArgs e) {
            if (e.Reason == NavigationItemStateChangeReason.UserAction && MyAccordion.GetSelectedItemInfo()?.Parent == e.ItemInfo) {
                MyAccordion.SelectItem(x => x == e.ItemInfo);
        }
    }
}

Expand State Change Reason

See Also