Hi,
How can I programmatically disable an Option set value. I dont want to remve it, just disable it.
The reason is that I have 2 Option sets, and selecting a Value in the first set automatically selects a corresponding value in the second one, and makes the other options in the second one unselectable.
Many thanks
Jason
Hi.
How Cancel the selection to certain option.
Example
I use the ValueChanged, to validate certains conditions, if some it's correct then accept this,
but it's false to reject the operation, and i need to return the original state of the selecction.
I don't think you can cancel the change. ValueChanged is past tense - it means that value has already changed. So it's too late to cancel.
I don't think the OptionSet has an event that fires before the selection changes. You should be able to set the Value or CheckedIndex inside the ValueChanged event to set it back to what it was. But you would have to keep track of the old value and also deal with how to avoid recursion (probably using the EventManager to disable the ValueChanged event while you are in it).
Hi,Does anybody know if this feature is going to be added soon.. So many times in our app we disable individual options. We don't want to remove them, we have coded around it a bit using the example above and some code to stop people clicking the option, but its a bit dirty. When we disable the item the background goes odd and doesn't conform to the theme and stuff.. Would be good if this feature is added.RegardsChris
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 :(