Skip to main content

DxAccordion.ClearSelection() Method

Clears selection.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public void ClearSelection()

Remarks

Set the SelectionMode property value to Single to allow item selection. Accordion items can be selected in the following ways:

  • Users can click item headers to select them.
  • You can call the SelectItem method to select an item from code.
  • The component can automatically select an item based on the item’s NavigateUrl and the current browser URL. Use the UrlMatchMode property to enable this functionality.

Call the ClearSelection method to deselect an item:

<DxAccordion @ref=@MyAccordion
             SelectionMode="NavigationSelectionMode.Single">
    <Items>
        <DxAccordionItem Text="Shapes">
            <Items>
                <DxAccordionItem Text="Circle" />
                <DxAccordionItem Text="Square" />
            </Items>
        </DxAccordionItem>
        <DxAccordionItem Text="Templates" />
    </Items>
</DxAccordion>

<DxButton Click="(() => MyAccordion.ClearSelection())">Clear Selection</DxButton>

@code {
    DxAccordion MyAccordion;
}
See Also