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

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?
 
K

Karl Seguin [MVP]

have you tried simply negating the value?

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

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

Karl
 
S

Steve

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top