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

DxFormLayoutGroup.ExpandedChanged Event

Fires when a Form Layout group 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 the group’s Expanded property value changes.

The following code snippet handles the ExpandedChanged event:

Razor
<DxFormLayout>
    <DxFormLayoutGroup Caption="Personal Information" 
                       ExpandedChanged="@ExpandedChanged"
                       ExpandButtonDisplayMode="GroupExpandButtonDisplayMode.Start">
        <DxFormLayoutItem Caption="First Name:">
            <DxTextBox />
        </DxFormLayoutItem>
        <DxFormLayoutItem Caption="Last Name:">
            <DxTextBox />
        </DxFormLayoutItem>

    </DxFormLayoutGroup>
</DxFormLayout>

The group is @GroupState

@code {
    string GroupState { get; set; } = "open";
    void ExpandedChanged(bool NewExpanded) {
        if (NewExpanded)
            GroupState = "open";
        else
            GroupState = "closed";
    }
}

Set the ExpandButtonDisplayMode property to Start or End to allow users to expand or collapse the group.

See Also