I have a (varchar) field Foo which can only be specified if (bit) Bar is not true. I would like the textbox in which Foo is displayed to be disabled when Bar is true — essentially, FooBox.Enabled = !isBar. I’m trying to do something like
FooBox.DataBindings.Add(new Binding('Enabled', source, '!isBar'));
but of course the bang in there throws an exception. I’ve also tried constructs like ‘isBar != true’ or ‘isBar <> true’, but none work. Am I barking up the wrong tree here?
I tried doing something like this a while ago and the best I could come up with was either
a) Changing the source class to also have a NotBar property and bind to that
b) Make a dumb wrapper class around source that has a NotBar property and bind to that.