How to present data on ASPxGrid in another pattern

Discussion in 'ASP .Net' started by ad, Mar 27, 2005.

  1. ad

    ad Guest

    I have a employee table, with a filed sexID
    The field store 1 for male and 2 for female.
    I want to display this field in a ASPxGrid with male or female , not 1 or 2.
    How can I do that?
     
    ad, Mar 27, 2005
    #1
    1. Advertising

  2. You need to transform the value. The easiest way is to convert the field to
    a template column and then use a tmeplate expression like this:

    <%# ( (int) DataBinder.Eval(Container,"DataItem.SexID")) == 1 ? "male" :
    "female" %>

    +++ Rick ---


    --

    Rick Strahl
    West Wind Technologies
    www.west-wind.com
    www.west-wind.com/weblog



    "ad" <> wrote in message
    news:#...
    > I have a employee table, with a filed sexID
    > The field store 1 for male and 2 for female.
    > I want to display this field in a ASPxGrid with male or female , not 1 or

    2.
    > How can I do that?
    >
    >
     
    Rick Strahl [MVP], Mar 27, 2005
    #2
    1. Advertising

  3. ad

    ad Guest

    Thank,
    But it result an System.InvalidCastException.
    How can I do?


    > You need to transform the value. The easiest way is to convert the field

    to
    > a template column and then use a tmeplate expression like this:
    >
    > <%# ( (int) DataBinder.Eval(Container,"DataItem.SexID")) == 1 ? "male" :
    > "female" %>
    >
    > +++ Rick ---
    >
    >
    > --
    >
    > Rick Strahl
    > West Wind Technologies
    > www.west-wind.com
    > www.west-wind.com/weblog
    >
    >
    >
    > "ad" <> wrote in message
    > news:#...
    > > I have a employee table, with a filed sexID
    > > The field store 1 for male and 2 for female.
    > > I want to display this field in a ASPxGrid with male or female , not 1

    or
    > 2.
    > > How can I do that?
    > >
    > >

    >
    >
     
    ad, Mar 27, 2005
    #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. ad
    Replies:
    3
    Views:
    495
    Mike Douglas
    Mar 27, 2005
  2. Gabriel_k
    Replies:
    0
    Views:
    416
    Gabriel_k
    Aug 12, 2003
  3. Ralf Wahner
    Replies:
    5
    Views:
    656
    Bob Foster
    Dec 24, 2003
  4. Jorgen Jensen

    DevExpress ASPxGrid control - linking to textboxes

    Jorgen Jensen, Jun 21, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    440
    Jorgen Jensen
    Jun 21, 2005
  5. Richard Lionheart
    Replies:
    12
    Views:
    241
    Richard Lionheart
    Jul 10, 2004
Loading...

Share This Page