Click here to Skip to main content
15,887,998 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

Below is the radio buttons i have in my form

VB
Dim a As String = ""
           If rdYesDiscountable.IsChecked = True Then
               a = "1"
           ElseIf rdNoDiscountable.IsChecked = True Then
               a = "0"
           End If

i am binding the values in the grid.
now in the grid it's showing if 1 then true else false

but i want to display Yes or No instead true or false.

Please tell me how to do this.

Thank you
Posted
Updated 15-Nov-13 17:27pm
v2

1 solution

Write your select query using case:


select *,dist as 'Distance',Veh_no as 'taxi_no',case when reply=0  then 'No' when reply=1 then 'Yes' else 'No Response' end as Reply



Then Bind 'Reply' field in your gridview like this:

<asp:boundfield datafield="Reply" headertext="Status" mode="hold" xmlns:asp="#unknown" /> <HeaderStyle Wrap="False" Font-Names="Arial" Font-Size="8pt" HorizontalAlign="Center" VerticalAlign="Middle" />
<ItemStyle HorizontalAlign="Center" Width="25px" VerticalAlign="Middle" />
</asp:BoundField>
 
Share this answer
 
v2
Comments
[no name] 16-Nov-13 1:44am    
Although u gave example for asp.net, but the query worked for me..
Thanks..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900