This is a migrated thread and some comments may be shown as answers.

DataFormatString for bool variable

2 Answers 367 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Katarina
Top achievements
Rank 1
Katarina asked on 27 Mar 2009, 02:13 PM
I have GridBoundColumn in my RadGrid and data in it are of type bool. But I dont want to see "True" and "False" on my form: I want something else to be written there. Can I use DataFormatString for that? And what format can I use?

2 Answers, 1 is accepted

Sort by
0
Katarina
Top achievements
Rank 1
answered on 27 Mar 2009, 02:13 PM
I forgot to say I want some other text there instead of true and false.
0
Daniel
Telerik team
answered on 27 Mar 2009, 04:58 PM
Hello Katarina,

Please try the following:
<telerik:GridTemplateColumn UniqueName="myBoolCol"
    <ItemTemplate> 
        <%# (bool)Eval("MyBool") ? "YES" : "NO" %> 
    </ItemTemplate> 
</telerik:GridTemplateColumn> 

Regards,
Daniel
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Katarina
Top achievements
Rank 1
Answers by
Katarina
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or