Databindings property - I want to disable true values rather than false values

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

As you know there is a databindings property 'Enabled' for fields in
the gridview.

In the custom binding section I have used the expression:
Eval("myfield"). 'myfield' is a boolean field I have in my database.

This (obviously) leads to all 'False' fields being disabled and 'True'
ones being enabled.

What expression can I used instead of Eval("myfield") for the 'Enabled'
databindings property to make all 'True' values disabled and all
'False' values enabled?
 
have you tried simply negating the value?

vb.net:
<%# not eval("myField") %>

C#
<%# ! Eval("MyField") %>

Karl
 
Karl, Thank a lot!

That did it! Sorry I couldn't figure that out.

So I guess I can use any valid vb/c expression? Even if statments?

Thank you very much!
 
Back
Top