Skip to main content

DxDropDown.IsOpen Property

Specifies whether the drop-down window is open.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public bool IsOpen { get; set; }

Property Value

Type Description
Boolean

true if the window is open; otherwise, false.

Remarks

Implement two-way binding for the IsOpen property to open and close the drop-down window in code and update the property value when a user closes the window. The IsOpenChanged event occurs when the property value changes.

<DxButton Id="showDDbtton" Click="() => IsOpen = true">Show a drop-down window</DxButton>
<DxDropDown PositionTarget="#showDDbtton"
            PositionMode="DropDownPositionMode.Bottom"
            HorizontalOffset="120"
            VerticalOffset="70"
            Width="210px"
            BodyText="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
            @bind-IsOpen="@IsOpen">
</DxDropDown>

@code {
    bool IsOpen { get; set; } = false;
}

You can handle the following events related to the IsOpen property’s changes:

  • Showing - Fires before the window is displayed and allows you to cancel this action.
  • Shown - Fires after the window is displayed.
  • Closing - Fires before the window is closed and allows you to cancel this action.
  • Closed - Fires after the window is closed.

The ShowAsync and CloseAsync methods allow you to show and close the drop-down window asynchronously.

See Also