I am having a problem adding a PopupMenuTool to an already existing PopupMenuTool. I am unable to post the code that I am using but I will try to explain.
I have an UltraWinGrid object (myWinGrid)
I have an UltraToolbarsManager object (mTBMgr).
I have a PopupMenuTool popMenu7 = new PopupMenuTool ("gridPopup").
- the popMenu7 PopupMenuTool contains a bunch of buttons
popMenu7.Tools.AddRange ( ToolBase[] { buttonTool40, buttonTool41, .....});
- the popMenu7 PopupMenuTool is added to the UltraToolbarsManager object
mTBMgr.Tools.AddRange ( ToolBase[] { button50, popMenu7 , button 51,.....} );
(All of this is logic is in the InitializeComponent method of my form)
I have a event handler to handle the OnMouseUp event for the grid (myWinGrid). Here is the code for that event
protected void myWinGridOnMouseUp(sender, e)
{
if (e.Button.Eqauls(MouseButton.Right)
PopupMenuTool contextMenu = mTBMgr.Tools["gridPopup"] as PopupMenuTool ;
PopupMenuTool newContext = new PopupMenuTool("Columns");
newContext.SharedProps.Caption = "Columns";
mTBMgr.Tools.Add(newContext );
contextMenu.Tools.AddTool("Columns");
contextMenu.ShowPopup();
}
When I run this code, the "Columns" popup menu is not displaying in the popMenu7 menu. If I step through the code and I examine the contents of the mTBMgr and popMenu7, the "Columns" popup menu exists in the Tools collection but it is not displaying.
We have 2 versions of Infragistics at our Company, version 8 (8.1.20081.1000) and version 10 (10.1.20101.1007). The code I have listed above works when I use version 8 of Infragistics but it does not work when I use version 10 of Infragistics.
Hi,
I want to add tools to popup menu dynamically. The tool is adding but not displaying on UI.after going through the blog I used refresh merge, here the problem comes tools are adding when ever the event triggers some shaking of trembling in UI is found. I am working on cad viewer development these sort of disturbances are not allowed on viewer.kindly please suggest a solution...thanx
Never mind, you are welcome!
Your description looked like my issue and I needed this issue solved too before switching from 2007.1 to 2010.3. Maybe this RefreshMerge() will end up in some documentation/Howto/FAQ due to our issues.
No worries. Glad I could help.
I have been working this issue for a couple weeks now, so I'm not sure whether to laugh or cry, but it turns out my problem was exactly the same as Dominiks. I am working on legacy code that I did not write and it has many different layers of extraction. I did not check to see if the toolbamanager that I was using was a merged toolbarmanager. Once I added the call to RefreshMerge(), my issue went away. So Mike, thanks for getting back to my posts so quickly, sorry if i wasted some of your time. And Dominik, thanks for posting your issue, you save me a ton of time because I was getting to the point where I was going to re-write a ton of code.
If you tried my code in a sample and it worked, but it won't work in your application, my only guess is that there is some other code in your application which is doing this. Maybe some property is being set on the UltraToolbarsManager in your application but not the sample. Or maybe the tools are hidden in your application for whatever reason. It is difficult to provide more help without seeing some code.