I've got a radio group using an UltraOptionSet that I would like to disable certain options in at different times.
I've tried looking for options on the set itself, but can only find the global enabled or disabled property.
The individual OptionSetItem objects don't seem to have an enabled property...
Does anyone know how this can be done?
Thanks
Hi,
No, there's is currently no way to disable items in the OptionSet. The only thing you could do is remove the item from the list so the user can't select it.
You should submit a feature request to Infragistics: Request a Feature or Component
I found a way:
Dim element As Infragistics.Win.OptionSetOptionButtonUIElement
element = DirectCast(UltraOptionSet1.UIElement.ChildElements(0).ChildElements(xxx), Infragistics.Win.OptionSetOptionButtonUIElement)
With element .Enabled = False .Invalidate()End With
Change xxx for the index of the ValueListItem you want to disable. Item still clickable though :(
When I try the following code in C#
Infragistics.Win.OptionSetOptionButtonUIElement element = default(Infragistics.Win.OptionSetOptionButtonUIElement); element = (Infragistics.Win.OptionSetOptionButtonUIElement)UltraOptionSet1.UIElement.ChildElements[0].ChildElements[xxx]; { element.Enabled = false; element.Invalidate();}
There are never any elements in ChildElements above, even though I have 4 items in the "UltraOptionSet1". Any Ideas?
When are you trying to execute this code? You would likely need to do this in a CreationFilter because the elements could be repositioned several times throughout the course of the application, and doing this in AfterCreateChildElements will ensure that you actually do have elements to work with.
-Matt
Please could put an example code to solve the above problem.