How to present data on ASPxGrid in another pattern

A

ad

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?
 
R

Rick Strahl [MVP]

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
 

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,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top