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

Specifies the UI element 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 string PositionTarget { get; set; }

#Property Value

Type Description
String

The CSS selector that identifies the target UI element.

#Remarks

Use the PositionMode property to specify the drop-down window’s position relative to the target element. The position takes into account the offset specified by the HorizontalOffset and VerticalOffset property values. In the following code snippet, the target element is defined by its id attribute:

Razor
<DxButton Id="showDDbtton" Click="() => IsOpen = true">Show a drop-down window</DxButton>
<DxDropDown PositionTarget="#showDDbtton"
            PositionMode="DropDownPositionMode.Bottom"
            HorizontalOffset="120"
            VerticalOffset="70"
            Width="210px"
            BodyText="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
            @bind-IsOpen="@IsOpen">
</DxDropDown>

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

Blazor DropDown Offsets

See Also