Skip to main content
A newer version of this page is available. .

DxDropDown.PositionRectangle Property

Specifies a rectangle object relative to the drop-down window’s position.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public Rectangle PositionRectangle { get; set; }

Property Value

Type Description
Rectangle

A rectangle object.

Remarks

The PositionRectangle property allows you to position a drop-down window relative to a custom area defined by a Rectangle object. Use the PositionMode property to specify the window position relative to the specified rectangle. Additionally, the position takes into account the HorizontalOffset and VerticalOffset property values.

The example below demonstrates how to display a drop-down window at the center of the specified rectangle.

@using System.Drawing

<DxButton Click="() => IsOpen = true">Show Window</DxButton>
<DxDropDown Width="400"
            @bind-IsOpen="@IsOpen"
            PositionRectangle="@rect"
            PositionMode="DropDownPositionMode.Center"
            BodyText="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
                      Maecenas porttitor congue massa.">
</DxDropDown>

@code {
    bool IsOpen { get; set; } = false;
    Rectangle rect = new Rectangle(x: 0, y: 0, width: 700, height: 500);
}
See Also