I’ve got a situation where the user can add new product IDs to the database, and the first thing I do is check if the ID already exists (there are a bunch of other qualifiers, but that’s all you need for this example). If the ID exists, I force the number they entered back to zero.
The button’s “enabled” property is bound to the int in the numeric input box being greater than zero. But, it doesn’t work correctly when I programatically set the number back to zero. To get it to go back to disabled again, I have to open the bindings dialog and close it again, and then it refreshes.
I also tried programatically setting “enabled” to 0, but that didn’t work either. Obviously, the expression binding never sees an update from one value to another and back to zero. Is that how this is supposed to work? I know I could just drop the binding and control it all programatically, but the binding would be cleaner. Can I force a refresh of the binding?
I’ve attached a window so you can see what I mean. If you enter any number but “2”, the “test” button should be enabled. If you enter “0” or “2”, the button should go disabled.
Enabled.zip (4.46 KB)