i want to replace cell value in a grid

  • Thread starter Thread starter zafar
  • Start date Start date
Z

zafar

I need to replace a cell value in grid

e.g i have field "user_gender" of data type int where 1 means
male and 0 means female. i did not make parent table for "gender",
because there is only 2 possible records in table. i am assuming 1 and
0 as male and female. i need; when data is retrieved from database all
0's must be replaced with "Female" and all 1's must be replaced with
"Male". One solution is this; that we use counter loop and set the
value of user_gender" field in dataset explicitly by checking
"user_gender" field. Is there any other solution..? I have several more
fields as well in table those should be replaced with specific values.
thanx for helping in this regard
 
When you retrieve the data from the database are you using SQL? If so you
can use a CASE statement to replace 1 with Male and 0 with Female. When the
data is bound to the datagrid, it will show the proper results.
 
Back
Top