Search results

Position popup open in Blazor Dropdown Menu component

Popup open position can be changed according to the requirement. Popup open position can be changed in OnOpen event by setting Top and Left for the popup element.

In the following example, the Top position of the popup element is changed in open event.

@using Syncfusion.Blazor.SplitButtons

<SfDropDownButton Content="EDIT">
    <DropDownButtonEvents OnOpen="Open"></DropDownButtonEvents>
    <DropDownButtonItems>
        <DropDownButtonItem Text="Cut"></DropDownButtonItem>
        <DropDownButtonItem Text="Copy"></DropDownButtonItem>
        <DropDownButtonItem Text="Paste"></DropDownButtonItem>
    </DropDownButtonItems>
</SfDropDownButton>

@code {
    public void Open(BeforeOpenCloseMenuEventArgs args)
    {
        args.Element.SetAttribute("style", "margin:-155px -27px");
    }
}

Output be like

Button Sample