Hi,
I added a button tool at runtime but it will not shown in the FileMenu. When I switch to another menu group and switch back to the FileMenu, the button tool is shown correctly. Is there a refresh call or something else? My code is the following (NetAdvantage Forms version is 2012.1 - .net runtime 2.0):
ultraToolbarsManager1.BeginUpdate();
string toolKey = Guid.NewGuid().ToString();
ButtonTool buttonTool = new ButtonTool(toolKey);
buttonTool.SharedProps.Caption = "Hello World";
ultraToolbarsManager1.Tools.Add(buttonTool);
ultraToolbarsManager1.Ribbon.ApplicationMenu2010.NavigationMenu.Tools.InsertTool(0, toolKey);
ultraToolbarsManager1.EndUpdate();
Thanks
BR
Sven
Hi Sven,
The UltraToolbarsManager does not extend a method for forcing the NavigationMenu to redraw itself once it has been modified, as this is an uncommon scenario; aside from explicitly closing the then re-opening the menu. The behavior that you are observing appears to be expected.
I have inquired to my development team regarding the possibility of circumventing this behavior and I will be following up with you regarding my findings.
Sincerely,Chris KDeveloper Support EngineerInfragistics, Inc.www.infragistics.com/support
Hi Chris,
thanks for your response.
When you have a look to the MS Word 2010 there is a menu item ‘Recent Documents’ in the file menu. In this menu is a check box for quick access to a number of recent documents. Please have a look to this (hope it’s ok to add this link)
http://www.youtube.com/watch?v=wornf7A9xhE
As you can see, the file menu will remain open.
By the way, removing items from the menu and adding seperators works well.
I have created CAS-96311-507CP to have my developers take a closer look at this behavior and I will be following up with you via that case.
If you have any questions in the meantime, please let me know.
I am also trying to add menu items into the ApplicationMenu2010 on the fly and I am interested what you decide to do about this issue. I am replying to this post in order to receive updates from Infragistics.
Thanks,
Bob
Hi Bob,
I found out that removing items refreshs the menu immetiately. So I created a temporary hidden dummy item and removed it at the end of my method.
Hope that helps.
Hi Naresh,
here is the sample code for the workaround:
ButtonTool dummyTool = new ButtonTool("++dummy++"); dummyTool.SharedProps.Visible = false; ultraToolbarsManager1.Tools.Add(dummyTool); ultraToolbarsManager1.Ribbon.ApplicationMenu2010.NavigationMenu.Tools.AddTool("++dummy++"); ultraToolbarsManager1.Ribbon.ApplicationMenu2010.NavigationMenu.Tools.Remove(dummyTool); ultraToolbarsManager1.Tools.Remove(dummyTool);Sven
I have a similar problem and tried the workaround and could not get it to work.
Can you place a sample on how to do this?
Naresh
Hi Bob,This behavior was addressed recently in the service releases for both builds 11.2.20112.2108, 12.1.20121.2050 and later; items added or removed from the menu are expected to cause the menu to refresh dynamically.
If you are observing some other behavior in these builds, please let me know.
Sure enough, that seems to work. Nice find and thanks for the tip!
So, if the menu automatically refreshes when an item is removed but not when an item is added, it seems like a bug in the Infragistics backstage code to me.
Regards,