Back to Devexpress

DxDropDownButtonBase.DropDownVisible Property

blazor-devexpress-dot-blazor-dot-dxdropdownbuttonbase-d35a123e.md

latest2.7 KB
Original Source

DxDropDownButtonBase.DropDownVisible Property

Specifies the current state of a drop-down element (visible/hidden).

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(false)]
[Parameter]
public bool DropDownVisible { get; set; }

Property Value

TypeDefaultDescription
Booleanfalse

true if the drop-down element is visible; otherwise, false.

|

Remarks

Use the DropDownVisible property to show/hide the target element’s drop-down menu or window.

The following components implement the DropDownVisible property:

DxDropDownButtonA toggleable button that reveals a drop-down element with a list of commands or custom content.DxSplitButtonA composite control that consists of a primary button and a toggleable secondary button that reveals a drop-down element.DxDropDownButtonItemDefines a drop-down list item. Used in DxDropDownButton or DxSplitButton.

To respond to the property change, handle the DropDownVisibleChanged event.

Example

The following code snippet displays the current visibility state of the DxDropDownButton component’ drop-down menu:

razor
<p>Is menu expanded - @IsDropDownVisible</p>

<DxDropDownButton Text="Blazor Components"
                  RenderStyleMode="ButtonRenderStyleMode.Outline"
                  DropDownVisible="@IsDropDownVisible"
                  DropDownVisibleChanged="OnDropDownVisibleChanged">
    <Items>
        <DxDropDownButtonItem Text="Documentation"
                              NavigateUrl="https://docs.devexpress.com/Blazor/400725/blazor-components" />
        <DxDropDownButtonItem Text="Demos"
                              NavigateUrl="https://demos.devexpress.com/blazor/" />
    </Items>
</DxDropDownButton>

@code {
    bool IsDropDownVisible = false;

    void OnDropDownVisibleChanged(bool isVisible) {
        IsDropDownVisible = isVisible;
    }
}

See Also

DxDropDownButtonBase Class

DxDropDownButtonBase Members

DevExpress.Blazor Namespace