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

DxAccordion.GetItemExpanded(Func<IAccordionItemInfo, Boolean>) Method

Returns whether the specified item is expanded.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public bool GetItemExpanded(
    Func<IAccordionItemInfo, bool> predicate
)

#Parameters

Name Type Description
predicate Func<IAccordionItemInfo, Boolean>

A delegate method that specifies the item.

#Returns

Type Description
Boolean

true if the item is expanded; otherwise, false.

#Remarks

Use the GetItemExpanded method to determine whether the item is expanded.

The following code snippet uses this method:

razor
<DxButton Click=@OnClick>Expanded?</DxButton>

<DxAccordion @ref=Accordion>
    <Items>
        <DxAccordionItem Text="Grid" />
        <DxAccordionItem Text="Navigation and Layout">
            <Items>
                <DxAccordionItem Text="Accordion" />
                <DxAccordionItem Text="Stack Layout" />
            </Items>
        </DxAccordionItem>
        <DxAccordionItem Text="Data Editors" />
        <DxAccordionItem Text="Scheduler" />
    </Items>
</DxAccordion>

@IsExpanded

@code {
    DxAccordion Accordion;
    bool? IsExpanded;
    void OnClick() {
        IsExpanded = Accordion.GetItemExpanded(i => i.Text == "Navigation and Layout");
    }
}
See Also