GridView: Change boolean values to Yes/No?

Discussion in 'ASP .Net' started by Prozon, Dec 6, 2004.

  1. Prozon

    Prozon Guest

    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
     
    Prozon, Dec 6, 2004
    #1
    1. Advertising

  2. Prozon

    Curt_C [MVP] Guest

    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" <> wrote in message
    news:...
    > 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
     
    Curt_C [MVP], Dec 6, 2004
    #2
    1. Advertising

  3. Prozon

    sushil.jinder

    Joined:
    Jun 15, 2007
    Messages:
    1
    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 :-?


     
    sushil.jinder, Jun 15, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. teo
    Replies:
    3
    Views:
    570
  2. J Leonard
    Replies:
    4
    Views:
    12,893
    Mark Space
    Jan 19, 2008
  3. SStory
    Replies:
    7
    Views:
    375
    SStory
    Jun 25, 2004
  4. Jamie Herre
    Replies:
    1
    Views:
    228
    why the lucky stiff
    Jan 7, 2005
  5. Metre Meter
    Replies:
    7
    Views:
    466
    Metre Meter
    Aug 6, 2010
Loading...

Share This Page