Skip to main content
All docs
V25.1
  • DxAccordion.GetItemExpanded(Func<IAccordionItemInfo, Boolean>) Method

    Returns whether the specified item is expanded.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.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 following code snippet uses 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