DxDropDown.ActivateAsync(CancellationToken) Method
Moves the drop-down window to the front of other popup elements.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v26.1.dll
NuGet Package: DevExpress.Blazor
Declaration
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.
<DxButton Id="showDDbtton1" Click="@OnClick1">Show DropDown 1</DxButton>
<DxButton Id="showDDbtton2" Click="@OnClick2">Show DropDown 2</DxButton>
<DxDropDown @ref="@dropdown1"
@bind-IsOpen="show1"
HeaderVisible="true"
HeaderText="DropDown 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 @ref="@dropdown2"
@bind-IsOpen="show2"
HeaderVisible="true"
HeaderText="DropDown 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"/>
@code {
DxDropDown dropdown1 { get; set; }
DxDropDown dropdown2 { get; set; }
bool show1;
bool show2;
void OnClick1() {
if (dropdown1.IsOpen) {
dropdown1.ActivateAsync();
}
else {
show1 = true;
}
}
void OnClick2() {
if (dropdown2.IsOpen) {
dropdown2.ActivateAsync();
}
else {
show2 = true;
}
}
}

See Also