I am using the UltraToolbar in my UltraGrid and I added some Tools[which I think are basically like menu items]. But I would like to hide some Tools[menu items] in certain circumstances. I dont see a easy way[couldnt find one at all] to do it. Could somebody point me in the right direction?. Here is my typical use case.
I have a menu like this in UltraGrid
Options
SubOption1
SubOption2
Now the issue is that I want to disable SubItem1[which is a button tool item] to start with and enable it when I need. Thanks
this.ultraToolbarsManager1.Tools["SubOptions1"].SharedProps.Enabled = false;
That doesnt seem to do anything. Could htis be a bug or is thre any other setting thats overriding it?
I don't see how this could possibly be a bug. It's some of the most basic functionality in the component, so if this didn't work, there'd be lots of people noticing it. The code I gave you here is just to disable the item, by the way, not to hide it. To hide a tool, you would use the Hidden property.
Anyway, my guess is that something in your code must be overriding the setting of the property. The most obvious thing that springs to mind is that you are loading your toolbar from a file.
To hide the tool, use ...SharedProps.Visible = False etc instead of Hidden = false (which isn't an option!)
Using SharedProps.Visible = False does not hide the tool for me--it only disables it (grayed out).
How do I hide an individual tool completely?
I saw another post that suggested that I should use myToolBarManager.Tools[1] instead of myToolBarManager.Tools to do this; however, the Tools collection on my toolbarmanager instance is null.
Thanks.
I know this thread is a year old, but I wanted to mention that tools("name").SharedProps.Visible = False does the same thing for me. The tool is disabled, NOT made invisible.
Yes, actually I found that out after reading this about 30 seconds ago :)
http://forums.labs.infragistics.com/readmessage?id=%3C3dc72a4$fa42ffb$184aae@news.infragistics.com%3E&group=infragistics.products.netadvantage.windowsforms.wintoolbars
Is the tool in the Ribbon? By default, tools in the ribbon cannot be hidden because it would violate the Office 2007 UI Guidelines which state that the contents of a ribbon tab cannot change based on state. If you would like to relax this restriction, set UltraToolbarsManager.Office2007UICompatibility to False.