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

DxFlyout.PreventCloseOnPositionTargetClick Property

Specifies whether the flyout window should be closed when a user clicks the position target element.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

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

#Property Value

Type Default Description
Boolean true

false to close the flyout window on any outside click; true to keep the flyout window open when the position target element is clicked.

#Remarks

If the CloseOnOutsideClick property is set to true, the flyout window is closed when a user clicks outside the window’s boundaries. However, the component prevents the window from closing when a user clicks an element specified by the PositionTarget property. This behavior allows you to change window visibility on a position target element click in the following way:

Razor
<DxButton Id="targetButton" Click="() => IsOpen = !IsOpen">Show/Hide a flyout window</DxButton>
<DxFlyout @bind-IsOpen=IsOpen 
          PositionTarget="#targetButton" 
          Width=400
          BodyText="Lorem ipsum dolor sit amet, consectetur adipiscing elit.">
</DxFlyout>

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

Set the PreventCloseOnPositionTargetClick property to false to close the flyout window when a user clicks the target element.

See Also