Databinding Expressions?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chike J. Okor

    Databinding Expressions?

    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.DataBi ndings.Add("Rea dOnly",customer s,"IsActive") ;

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

    Thanx
    Chike, London


  • Dmitriy Lapshin [C# / .NET MVP]

    #2
    Re: Databinding Expressions?

    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.

    --
    Dmitriy Lapshin [C# / .NET MVP]
    X-Unity Test Studio

    Bring the power of unit testing to VS .NET IDE

    "Chike J. Okor" <chike@okor.co. uk> wrote in message
    news:%23ClHxnSj DHA.1772@TK2MSF TNGP10.phx.gbl. ..[color=blue]
    > Is it possible to Databind to an expression? I have a collection of[/color]
    classes[color=blue]
    > and one of the properties returns a boolean value. I'm trying to databind
    > to the "inverse" of the boolean value as such
    >
    > TextBox1.DataBi ndings.Add("Rea dOnly",customer s,"IsActive") ;
    >
    > I need to bind this to the Inverse of IsActive (!IsActive) and not[/color]
    IsActive[color=blue]
    > itself ... it this possible?
    >
    > Thanx
    > Chike, London
    >
    >[/color]

    Comment

    Working...