Databinding Expressions?

  • Thread starter Thread starter Chike J. Okor
  • Start date Start date
C

Chike J. Okor

Is it possible to Databind to an expression? I have a collection of classes
and one of the properties returns a boolean value. I'm trying to databind
to the "inverse" of the boolean value as such

TextBox1.DataBindings.Add("ReadOnly",customers,"IsActive");

I need to bind this to the Inverse of IsActive (!IsActive) and not IsActive
itself ... it this possible?

Thanx
Chike, London
 
Hi Chike,

I beleive it will be easier to introduce an additional property called
IsNotActive :-)
However, if this is out of the question, you can probably make good use of
the Binding class' Format and Parse events to carry out the inverstion on
the fly.
 
Back
Top