Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView: Change boolean values to Yes/No?

Reply
Thread Tools

GridView: Change boolean values to Yes/No?

 
 
Prozon
Guest
Posts: n/a
 
      12-06-2004
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
 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      12-06-2004
Use a template column, wrap a simple funtion around the databind.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


"Prozon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m...
> 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



 
Reply With Quote
 
 
 
 
sushil.jinder sushil.jinder is offline
Junior Member
Join Date: Jun 2007
Posts: 1
 
      06-15-2007
Hi Steve,

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

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

Thanks
Sushil Jinder


Quote:
Originally Posted by 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subtle difference between boolean value and boolean comparison? Metre Meter Javascript 7 08-06-2010 08:40 PM
difference between 'boolean' and 'java.lang.Boolean' J Leonard Java 4 01-19-2008 02:56 AM
Change in Display values in Boolean DataColumn in DataGridView Lucky ASP .Net 3 06-27-2006 12:18 PM
Using Boolean Values Paul ASP .Net 0 04-20-2006 12:41 PM
Unable get Boolean and Numeric values from XLS into Dataset and Datagrid vighnesh ASP .Net 3 08-04-2005 02:16 PM



Advertisments