Present WebContextualMenu in listbox cell?

Hey,
Does anyone know if there’s a way to present a WebContextualMenu at the location of the selected cell in a WebListbox?
Like if you right click on a cell the menu would show up at the cell that was clicked.
When presented it shows up in all its glory at the top of the listbox.

Is this possible? It could very much be me just overlooking something. That has happened before :wink:

Hmm, just realized that I somehow need to disable the browsers ContextualMenu that appears on a right click too if this is to work properly… :confused:

EDIT: Solved this one using JS.

I guess one option would be to recreate something that looks like a contextual menu using a listbox and display that when a cell is right clicked. That may just be to much work for its purpose though. hmm…

You can create contextualmenus in JavaScript. That would be the best route.

Thanks Michel, I’ll look into that.

Albin, I looked at how I am doing that in web pages.

The simplest way is to create a small weblistbox that you keep off view, and move at the desired place when you need the menu. In JavaScript you have the position of the click. Then you will have all the logic of a WebListBox at your disposal.

Style it like the normal ContextualMenu, you should be close enough.

That is probably the best way to go at it. Thank you Michel! I’ll let you know how it turns out when/if it gets done. It’s a large project for a customer but it’s on the todo list :slight_smile:

I routinely use this kind of technique. Especially in iOS where ContextualMenu does not exist, and where I employ a lot of HTML/CSS/JS to build the UI.