Skip to main content

DxAccordionItem.ExpandedChanged Event

Fires when an Accordion’s item expands or collapses.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public EventCallback<bool> ExpandedChanged { get; set; }

Parameters

Type Description
Boolean

The new Expanded property value.

Remarks

The ExpandedChanged event allows you to handle changes to the item’s Expanded property value. The following code snippet changes the item’s Text when a user expands or collapses the item:

<DxAccordion>
    <Items>
        <DxAccordionItem Text="Grid" />
        <DxAccordionItem Text=@ItemText ExpandedChanged=@ExpandedChanged>
            <Items>
                <DxAccordionItem Text="Accordion" />
                <DxAccordionItem Text="Stack Layout" />
            </Items>
        </DxAccordionItem>
        <DxAccordionItem Text="Data Editors" />
        <DxAccordionItem Text="Scheduler" />
    </Items>
</DxAccordion>

@code {
    string ItemText { get; set; } = "Show Navigation and Layout";
    void ExpandedChanged(bool Expanded) {
        if (Expanded) {
            ItemText = "Hide Navigation and Layout";
        }
        else
            ItemText = "Show Navigation and Layout";
    }
}

Expansion state changes

See Also