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

Rad GridView Checkbox where text should be...

2 Answers 164 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 16 Jan 2015, 09:37 PM
I'm thoroughly confused.. Please help.
Then following xaml displays two columns of text, followed by two columns of checkboxes... But you can see that the third column, "tight Hole" does not define a checkbox style. I removed the cell header style also, and I still have a checkbox column there! What am I doing wrong? 

<telerik:RadGridView.Columns>
     <telerik:GridViewDataColumn Header="Property ID" DataMemberBinding="{Binding PropertyID}"              IsReadOnly="True" HeaderCellStyle="{StaticResource HeaderStyle}" Width="100" TextAlignment="Left" />
       <telerik:GridViewDataColumn Header="Property Name" DataMemberBinding="{Binding Property.PropertyName}" IsReadOnly="True" HeaderCellStyle="{StaticResource HeaderStyle}" Width="200" TextAlignment="Left" />
       <telerik:GridViewDataColumn Header="Tight Hole" DataMemberBinding="{Binding Property.TightHole}"       IsReadOnly="True" Width="100" TextAlignment="Left"  />
        <telerik:GridViewCheckBoxColumn Header="Read Only" DataMemberBinding="{Binding ReadOnly}"              IsReadOnly="False" HeaderCellStyle="{StaticResource HeaderStyle}" Width="100" CellStyle="{StaticResource StyleChkBoxCenter}" />

Just for FYI purposes, I define the Grid like this: 

<telerik:RadGridView x:Name="gvProperties" Grid.Row="2" 
                                                 ItemsSource="{Binding WellAssignments}"
                                                 Margin="0,5,0,0"
                                                 AutoGenerateColumns="False" CanUserFreezeColumns="False" 
                                                 CanUserDeleteRows="True" CanUserInsertRows="False" ShowGroupPanel="False" 
                                                 IsFilteringAllowed="False" IsReadOnly="False"
                                                 EnableLostFocusSelectedState="False"
                                                 GridLinesVisibility="None" 
                                                 ScrollMode="RealTime"
                                                 SelectionMode="Extended"
                                                 IsSynchronizedWithCurrentItem="True"
                                         >

The attached images show what I have and what I need. I need that third column to be text!

2 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 19 Jan 2015, 09:34 AM
Hello Richard,


The checkboxes are automatically generated, based on underlying data type. Perhaps you have defined either a data column or check box column in code behind. What you may do is to predefine the CellTemplate of the third column, bind the TextBlock's TextProperty to this boolean value. Then through a converter return the corresponding value either "True" or "False". 

You could read more about this in our documentation, here. 

Regards,
Vanya Pavlova
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Richard
Top achievements
Rank 1
answered on 19 Jan 2015, 02:28 PM
Thank you. I'm doing exactly that this morning! I suspected that checkboxes were automatically generated after having manual define checkboxes early in this project. (the automatic generation wasn't working and then it started working after I need to convert tight hole back to a string - weird!!!)

Thanks again!

Richard
Tags
GridView
Asked by
Richard
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Richard
Top achievements
Rank 1
Share this question
or