Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replacing Boolean Value with Yes/No in DataGrid

Status
Not open for further replies.

davecapone

Programmer
Oct 3, 2000
48
US
I have a DataGrid bound to a DataSource which contains a boolean DataField. I am wondering if there is a way to display Yes/No in the DataGrid instead of True/False?

Can you do:

<%#
if (DataBinder.Eval(Container.DataItem,&quot;boolField&quot;))
response.write &quot;Yes&quot;;
else
response.write &quot;No&quot;;
%>
 
Well, I figured out one way to do it with a Tertiary Operator as follows:

<%# (Convert.ToBoolean(DataBinder.Eval(Container.DataItem,&quot;CustomerAvailable&quot;))?&quot;Yes&quot;:&quot;No&quot;) %>

Is there a Better/More Efficient Way?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top