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.ActivateAsync(CancellationToken) Method

Moves the drop-down window to the front of other popup elements.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public Task ActivateAsync(
    CancellationToken token = default(CancellationToken)
)

#Optional Parameters

Name Type Default Description
token CancellationToken null

An object that propagates a cancellation notification.

#Returns

Type Description
Task

The task that is completed when the drop-down window is activated.

#Remarks

Call the ActivateAsync method to move the drop-down window in front of other elements.

Razor
<DxButton Id="showDDbtton1" Click="@OnClick1">Show Window 1</DxButton>
<DxButton Id="showDDbtton2" Click="@OnClick2">Show Window 2</DxButton>
<DxDropDown @ref="@window1"
            HeaderVisible="true" HeaderText="Window 1"
            PositionTarget="#showDDbtton1" PositionMode="DropDownPositionMode.Bottom"
            CloseOnOutsideClick="false"
            BodyText="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
            incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
            exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
            Width="400px">
</DxDropDown>
<DxDropDown @ref="@window2"
            HeaderVisible="true" HeaderText="Window 2"
            PositionTarget="#showDDbtton2" PositionMode="DropDownPositionMode.Bottom"
            CloseOnOutsideClick="false"
            BodyText="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
            incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
            exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
            Width="400px">
</DxDropDown>

@code {
    DxDropDown window1 { get; set; }
    DxDropDown window2 { get; set; }

    void OnClick1() {
        if (window1.IsOpen) {
            window1.ActivateAsync();
        }
        else {
            window1.IsOpen = true;
        }
    }
    void OnClick2() {
        if (window2.IsOpen) {
            window2.ActivateAsync();
        }
        else {
            window2.IsOpen = true;
        }
    }

}

See Also