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 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.
Sincerely,Chris KDeveloper Support EngineerInfragistics, Inc.www.infragistics.com/support
Hi Sven,
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,
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.