i have a treenodes.Nodes are on the left side and clicking on it opens a report on the screen. Following are the scenario steps:
1.>when the user clicks on a node. Report opens in the screen.
2>right click on a node. some items displays.
3.>right click on another node same item displays. rather here different items(i.e. item of this particular node) should be displayed.
Context menu is set on mouseDown event and in beforeToolDropDown the pop up menu items are being set.
The right click options are working fine when the report is not opened. But when the report is opened it is taking the items of the report which is being opened not in the node which the user clicks.
I am able to get the node properly and pop up items are being set correctly when i debug and see. But when i remove the break point from beforeToolDropDown problem arises.
Thanks & Regards,
George
Okay... then I still don't understand what you are asking.
Hi Mike,
I think you get me wrong here. I have already set the Selected property on the node to true on a Right-click.
I am able to get the node ids perfectly fine.
The right click also works perfectly fine when the report is not opened.
The problem arises when the report opens.
Okay, so you are using the SelectedNodes collection as your context. Right-clicking a node doesn't select that node. So in the MouseDown, set the Selected property on the node to true on a Right-click.
on mouse down i am doing
utbManager.SetContextMenuUltra(tvwBrokerPrices, "BrokerPricesPopup"); node.Selected = true;
and i am handling the right click event in
private void utbManager_BeforeToolDropdown(object sender, BeforeToolDropdownEventArgs e) {..
string[] key = tree.SelectedNodes[0].Key.Split(delimiter); string productGroupId = key[0];
..
if (status == "UNACCEPTED") {
popupMenuTool.Tools["approveGroupPrices"].SharedProps.Caption = "Unaccept Prices"; popupMenuTool.Tools["approveGroupPrices"].SharedProps.AppearancesSmall.Appearance.Image = global::ParMain.Properties.Resources.unaccept; popupMenuTool.Tools["ApproveGroupPricesThroughPriceCurve"].SharedProps.Caption = "Accept through Price Curves"; popupMenuTool.Tools["ApproveGroupPricesThroughPriceCurve"].SharedProps.Enabled = false;
}
else
{
popupMenuTool.Tools["approveGroupPrices"].SharedProps.Caption = "Accept Prices"; popupMenuTool.Tools["approveGroupPrices"].SharedProps.AppearancesSmall.Appearance.Image = global::ParMain.Properties.Resources.Accept; popupMenuTool.Tools["ApproveGroupPricesThroughPriceCurve"].SharedProps.Caption = "Accept through Price Curves"; popupMenuTool.Tools["ApproveGroupPricesThroughPriceCurve"].SharedProps.Enabled = true;
}..
..}
so now here you can see if status (which we get from db based on product key which we get when user right cliicks on an item) is "Accepted" then pop up containing Accepted image and label will appear. And if Status is UnAccepted then pop up containing Unaccepted label and image will come.
Now here's the catch
--user left click on the node.
--report will open in the screen.(suppose this report status is Accepted)
--user right click on the same node. Pop up containing same Accepted image and label will come.
--Now user Right clicks on different node(this node status is "UnAccepted").
--Pop up appears but the items in it i.e Image and label is of Accepted rather than that of UnAccepted.
Suman George
Hi George,
I'm having a very difficult time understand the question.
It sounds like you want the tree to respond to a right-click in the same way it does to a click. Or you want the context menu items to know which item was right-clicked. Either way, you need to do something in MouseDown to either activate, select, or record the node that was right-clicked and then use that later when you launch your report. But since I don't know what you are using to determine the node to use to launch the report, it's impossible for me to say exactly which one you need to do.