Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxDropDown.CloseOnOutsideClick Property

Specifies whether the drop-down window should be closed when a user clicks outside the window’s boundaries.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(true)]
[Parameter]
public bool CloseOnOutsideClick { get; set; }

#Property Value

Type Default Description
Boolean true

true to close the drop-down window in response to a click outside the element; otherwise, false.

#Remarks

Users can close a drop-down window in the following ways:

  • Press Escape.
  • Click outside the window’s boundaries.

Set the CloseOnOutsideClick property to false to keep the drop-down window open in response to a click outside the element.

<DxButton Id="showDDbtton" Click="() => IsOpenWindow = true">Show Window</DxButton>
<DxDropDown @bind-IsOpen="@IsOpenWindow"
            PositionTarget="#showDDbtton"
            PositionMode="DropDownPositionMode.Bottom"
            CloseOnOutsideClick="false"
            FooterVisible="true"
            BodyText="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
            incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
            exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
            Width="400" >
    <FooterContentTemplate>
        @* In a template, you can use the context.CloseCallback property 
           to implement a custom close action. *@
        <DxButton Text="OK" Click="@context.CloseCallback" />
    </FooterContentTemplate>
</DxDropDown>

@code {
    bool IsOpenWindow { get; set; } = false;
}
See Also