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.PositionRectangle Property

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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 following code snippet displays a drop-down window at the center of the specified rectangle.

Razor
@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