Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxAccordionItem.ExpandedChanged Event

Fires when an Accordion’s item expands or collapses.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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:

Razor
<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";
    }
}

See Also