blazor-devexpress-dot-blazor-dot-dxdropdown-465a56cf.md
Specifies whether the drop-down window should be closed when a user clicks outside the window’s boundaries.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[DefaultValue(true)]
[Parameter]
public bool CloseOnOutsideClick { get; set; }
| Type | Default | Description |
|---|---|---|
| Boolean | true |
true to close the drop-down window in response to a click outside the element; otherwise, false.
|
Users can close a drop-down window in the following ways:
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