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

CheckBox in GridView.DataColumn.CellTemplate

5 Answers 233 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 31 Aug 2011, 08:28 PM
Hello I was wondering if there is a way to make the checkbox that appears in the respective columns "un-checkable" , essentially read only. I say that because when I set the column to be read only the user is still able to check the checkbox. Even if I set the whole RadGridView
<telerik:GridViewDataColumn Width="40" IsReadOnly="True">
                                   <telerik:GridViewDataColumn.Header>
                                       <StackPanel>
                                           <TextBlock Text="Lab"></TextBlock>
                                           <TextBlock Text="Req"></TextBlock>
                                       </StackPanel>
                                   </telerik:GridViewDataColumn.Header>
                                   <telerik:GridViewDataColumn.CellTemplate>
                                       <DataTemplate>
                                           <CheckBox HorizontalAlignment="Left" VerticalAlignment="Center" IsChecked="{Binding LabRequired}" />                                                                                                                               
                                       </DataTemplate>
                                   </telerik:GridViewDataColumn.CellTemplate>
                               <telerik:GridViewDataColumn.CellStyle>
                                   <Style TargetType="telerik:GridViewCell">
                                       <Setter Property="Background" Value="{Binding LabStatus, Converter={StaticResource MyConverter}}" />
                                   </Style>
                               </telerik:GridViewDataColumn.CellStyle>
                           </telerik:GridViewDataColumn>
to read only along with the individual columns it still is able to be clicked.

5 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 01 Sep 2011, 09:19 AM
Hi Sean,

You may use a GridViewCheckBoxColumn instead that will listen for the IsReadOnly property and will become non-editable if it is set to "True".
 

Greetings,
Maya
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Sean
Top achievements
Rank 1
answered on 01 Sep 2011, 12:51 PM
Wonderful! I didn't even know you guys had that type of column for the RadGridView (WPF). Thank you so much.

Sean
0
Sean
Top achievements
Rank 1
answered on 01 Sep 2011, 02:56 PM
Ok so I tried to add a CheckBox Column and there isn't one. There is a ComboBox column but not a CheckBox. We are using Q2 2011 for WPF. What's the deal?


Thank you.

Sean
0
Sean
Top achievements
Rank 1
answered on 01 Sep 2011, 02:57 PM
Found it you guys rock!

Sean
0
Rajendra
Top achievements
Rank 1
answered on 24 Aug 2012, 08:52 AM
When the data type is string or Float the value should be in text,  if Data type is Boolean, value should be in Checkbox. When It is Enum, value should be a comboBox. Please find the attached "requirment.png" for more detail.

 Please let me know, How do I achieve this ? 
*I am using Telerik:RadGrid 
 
Tags
GridView
Asked by
Sean
Top achievements
Rank 1
Answers by
Maya
Telerik team
Sean
Top achievements
Rank 1
Rajendra
Top achievements
Rank 1
Share this question
or