How to present data on ASPxGrid in another pattern

  • Thread starter Thread starter ad
  • Start date Start date
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?
 
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

Back
Top