Skip to main content

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

Returns whether the specified item is expanded.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

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 example below shows how to use this method:

<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