J
JT
Hi,
I would like to know if it's possible to detect clicks on parent menus. I'm
wanting to map a tree structure to a menu structure. The "data" is not just
located in the leaf nodes of the tree; the parent nodes also have data. When
a node is selected from the tree, I want an action to occur (say, a dialog
come up). Let's say I have the following menu structure (which is a direct
mapping of my original tree data):
root
|_ Node 1
| |_ Node 1-1
| |_ Node 1-2
|_ Node 2
|_ Node 2-1
|_ Node 2-2
I want to be able to click on Nodes 1 or 2 and have a dialog come up. By
default, clicking on those menu items makes the children menu appear (Node
1-1 and Node 1-2, or Node 2-1 and Node 2-2). That can already happen by
hovering over those menu items, so I find it redundant that clicking on them
does the same thing. Therefore, if the user clicks on Node 1 and Node 2, I
would want the application to detect the click and make something happen.
Is the above possible? Simply adding a handler for the click event does
nothing; it never gets called (for menu items that have children items).
Then I tried subclassing the MenuItem class, and overriding the OnClick()
method; but that didn't work either, OnClick() never gets called... Help!
Thanks
JT
I would like to know if it's possible to detect clicks on parent menus. I'm
wanting to map a tree structure to a menu structure. The "data" is not just
located in the leaf nodes of the tree; the parent nodes also have data. When
a node is selected from the tree, I want an action to occur (say, a dialog
come up). Let's say I have the following menu structure (which is a direct
mapping of my original tree data):
root
|_ Node 1
| |_ Node 1-1
| |_ Node 1-2
|_ Node 2
|_ Node 2-1
|_ Node 2-2
I want to be able to click on Nodes 1 or 2 and have a dialog come up. By
default, clicking on those menu items makes the children menu appear (Node
1-1 and Node 1-2, or Node 2-1 and Node 2-2). That can already happen by
hovering over those menu items, so I find it redundant that clicking on them
does the same thing. Therefore, if the user clicks on Node 1 and Node 2, I
would want the application to detect the click and make something happen.
Is the above possible? Simply adding a handler for the click event does
nothing; it never gets called (for menu items that have children items).
Then I tried subclassing the MenuItem class, and overriding the OnClick()
method; but that didn't work either, OnClick() never gets called... Help!
Thanks
JT