Skip to main content
All docs
V25.2
  • DxFlyout.RestrictionTarget Property

    Specifies a target element that restricts the flyout window’s position.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.2.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    [Parameter]
    public string RestrictionTarget { get; set; }

    Property Value

    Type Description
    String

    A string that identifies the target element.

    Remarks

    When the RestrictionMode property is set to TargetElement, the flyout window’s position is restricted by an element specified in the RestrictionTarget property.

    Run Demo: Flyout - Automatic Position Adjustment

    <OptionsContent>
        <OptionComboBox Label="Close mode:" CssClass="ow-100" Data="@CloseModes" @bind-Value="@CloseMode"/>
        <OptionCheckBox Label="Fit to container" @bind-Checked="FitToRestriction"/>
    </OptionsContent>
    <ChildContentWithParameters Context="Params">
        <div class="@(IsMobile ? "" : "card") flipping-overflow-container">
            <dxbl-demo-scrollable center-horizontally center-vertically id="flipping-target-container" class="flipping-overflow-content">
                <DxButton
                    CssClass="flipping-button"
                    RenderStyle="@ButtonRenderStyle.Secondary"
                    Click="() => IsOpen = !IsOpen"
                    aria-describedby="flyout-flipping">SHOW A FLYOUT</DxButton>
            </dxbl-demo-scrollable>
            <DxFlyout
                @bind-IsOpen=IsOpen
                Id="flyout-flipping"
                PositionTarget=".flipping-button"
                RestrictionTarget=".flipping-overflow-container"
                RestrictionMode="FlyoutRestrictionMode.TargetElement"
                CloseOnOutsideClick="false"
                PreventCloseOnPositionTargetClick="true"
                CloseMode="@CloseMode"
                FitToRestriction="@FitToRestriction"
                SizeMode="Params.SizeMode"
                Width="240">
                <span class="fs-75">@Constants.ContentShort</span>
            </DxFlyout>
        </div>
    </ChildContentWithParameters>
    
    @code {
    @* ... *@
    bool IsOpen { get; set; } = false;
    bool IsMobile { get; set; }
    bool FitToRestriction { get; set; }
    FlyoutCloseMode[] CloseModes { get; } = Enum.GetValues<FlyoutCloseMode>();
    FlyoutCloseMode CloseMode { get; set; } = FlyoutCloseMode.Hide;
    @* ... *@
    }
    
    See Also