Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 04, 2012 11:00 PM by wavemaster
Participant
1295 Points
1131 Posts
Jul 04, 2012 09:17 PM|LINK
My table has a column with datatype bit, i.e. I have zeros or ones in the table.
When I display information from table I want it to show Yes or No.
Is there a way to do this elegantly?
Robert TIA
Contributor
5470 Points
737 Posts
Jul 04, 2012 10:03 PM|LINK
As an example you could format the WebGrid column in this way:
grid.Column("columnName", format: @<text>@(item.bitField ? "Yes" : "No")</text>))
Jul 04, 2012 11:00 PM|LINK
Thanks!
wavemaster
Participant
1295 Points
1131 Posts
display boolean in webgrid as Yes or No
Jul 04, 2012 09:17 PM|LINK
My table has a column with datatype bit, i.e. I have zeros or ones in the table.
When I display information from table I want it to show Yes or No.
Is there a way to do this elegantly?
Robert TIA
GmGregori
Contributor
5470 Points
737 Posts
Re: display boolean in webgrid as Yes or No
Jul 04, 2012 10:03 PM|LINK
As an example you could format the WebGrid column in this way:
grid.Column("columnName", format: @<text>@(item.bitField ? "Yes" : "No")</text>))wavemaster
Participant
1295 Points
1131 Posts
Re: display boolean in webgrid as Yes or No
Jul 04, 2012 11:00 PM|LINK
Thanks!