Open GridContextMenu programatically


what I am trying to achieve is to open dynamically generated GridContextMenu by clicking a Button in certain row. Problem is that I can’t open GridContextMenu using Button (as I can do using “normal” ContextMenu) and I can’t either dynamically generate items in “normal” ContextMenu (as I can do using GridContextMenu).

Do you have any ideas on how to workaround this?

You cannot attach GridContextMenu to Button, but you can make it open with left click using menu.setOpenOnClick(true); And you can have something that looks like button in the Grid cell, if the purpose of it is to have visual que for user to click.

Yes, but it will open menu even if I want to just select item without editing it, which is undesirable.