I have a blazor data grid with the built in context menu, and I also have a button in one of the rows that targets a context menu on click. Both Context Menus open fine when I am at the top of the page, but when I scroll down on the page the context menu gets to be misaligned.
Code that runs when I click the button to open the context menu:
public SfContextMenu<MenuItem> ContextMenuFromButton;
public async Task ContextMenuOpenFromButton(MouseEventArgs e, Guid id)
{
await ContextMenuOpenHandler(id);
ContextMenuFromButton.Open(e.ClientX, e.ClientY);
}
How do I keep proper alignment of context menu everywhere on the page?
See attached vide
Is there any update on this? I had to downgrade to version 19.1.0.69 to get this to work right.
|
<GridColumns>
<GridColumn Field=@nameof(OrdersDetails.EmployeeID) HeaderText="Employee Id" IsPrimaryKey="true" TextAlign="@TextAlign.Center" HeaderTextAlign="@TextAlign.Center" Width="140"></GridColumn>
<Template>
@{
<div id="target">
<SfContextMenu @ref="contextMenuObj" TValue="MenuItem">
<MenuItems>
<MenuItem Text="Cut"></MenuItem>
<MenuItem Text="Copy"></MenuItem>
<MenuItem Text="Paste"></MenuItem>
</MenuItems>
</SfContextMenu>
<SfButton OnClick="OpenContextMenu">Open ContextMenu</SfButton>
</div>
}
</Template></GridColumn>
SfContextMenu<MenuItem> contextMenuObj;
private void OpenContextMenu(MouseEventArgs e)
{
contextMenuObj.Open(e.ClientX, e.ClientY);
} |