This question is locked. New answers and comments are not allowed.
My users want to see a Yes or No instead of the check boxes on the Grid when a boolean column is shown. I attempted to create a converter for the column to return "Yes" or "No" but nothing shows up in the column. When I click on the Filters it shows Yes and No in the list of values that I can check.
<Telerik:GridViewDataColumn Header="Forecast?" DataMemberBinding="{Binding Model.HasForecast, Converter={StaticResource BoolConverter}}" IsReadOnly="True" TextAlignment="Center"/>
4 Answers, 1 is accepted
0
Hi Jimmy,
Yavor Georgiev
the Telerik team
You need to set the DataType of the column to string for this to work. Because the backing property is a boolean, the GridViewDataColumn tries to create a Checkbox control, which then fails when the converter returns a string.
Kind regards,Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Jimmy
Top achievements
Rank 1
answered on 22 Jul 2010, 02:34 PM
So how to set the data type. I have searched and found a couple of blogs with DataType="{x:Null}", but that doesnt solve the problem.
Attempted DataType="{x:String}" and DataType="{x:string}" but x does not contain those.
Did find one suggestion DataType="{x:Type sys:String}" but that give me an error that Type doesnt exist in x.
Attempted DataType="{x:String}" and DataType="{x:string}" but x does not contain those.
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Did find one suggestion DataType="{x:Type sys:String}" but that give me an error that Type doesnt exist in x.
0
Hi Jimmy,
Yavor Georgiev
the Telerik team
Setting a type from XAML is pretty tricky in Silverlight. You need to do it from code-behind, I'm afraid. See attached sample application.
Greetings,Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Carlos
Top achievements
Rank 1
answered on 07 Oct 2010, 10:34 PM
It would be nice if you guys added TypeConverter support so that you could convert from a string to a type...