GridView: Change boolean values to Yes/No?

P

Prozon

Hi!
I have an asp.net page with a gridview. One "columnfield" in the grid
contains boolean values. Is there a nice way to map this values to a
string depending on the value. I.e I want to display the text "Yes" if
true and "No" if false.

Thanks
/ Steve
 
Joined
Jun 15, 2007
Messages
1
Reaction score
0
Changing Boolean Values to Yes/No

Hi Steve,

You can simply wrap the boolean values in a If clause like this

Response.write(blFlag ? "YES" : "NO");

Thanks
Sushil Jinder :-?


Prozon said:
Hi!
I have an asp.net page with a gridview. One "columnfield" in the grid
contains boolean values. Is there a nice way to map this values to a
string depending on the value. I.e I want to display the text "Yes" if
true and "No" if false.

Thanks
/ Steve
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top