Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to present data on ASPxGrid in another pattern

Reply
Thread Tools

How to present data on ASPxGrid in another pattern

 
 
ad
Guest
Posts: n/a
 
      03-27-2005
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?


 
Reply With Quote
 
 
 
 
Rick Strahl [MVP]
Guest
Posts: n/a
 
      03-27-2005

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



 
Reply With Quote
 
 
 
 
ad
Guest
Posts: n/a
 
      03-27-2005
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" <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
> > 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?
> >
> >

>
>



 
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
OS present but not present. XPD NZ Computing 4 04-11-2007 11:22 PM
ASPxGRID with EDIT soft4raju Software 0 07-27-2006 11:51 AM
DevExpress ASPxGrid control - linking to textboxes Jorgen Jensen ASP .Net Web Controls 1 06-21-2005 09:33 AM
How to present data on datagrid in another pattern ad ASP .Net 3 03-27-2005 02:13 AM
Schema: express that "@a present if and only if @b present", where @a, @b are attributes Ralf Wahner XML 5 12-24-2003 11:37 AM



Advertisments