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

CheckBox column has no border

2 Answers 38 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Orit
Top achievements
Rank 1
Orit asked on 10 Aug 2009, 07:53 AM
Hy
I add a CheckBox  column to my grid
and now there is no border to the column
this is the code

<telerik:RadGridView.Resources> 
                    <ControlTemplate x:Key="cellTemplate" TargetType="{x:Type telerik:GridViewCell}">  
                        <CheckBox IsChecked="{Binding Field.Record.Data.Add, RelativeSource={RelativeSource TemplatedParent}}"   
                                                    HorizontalAlignment="Center" VerticalAlignment="Center" /> 
                    </ControlTemplate> 
                    <Style x:Key="booleanCellStyle">  
                        <Setter Property="telerik:GridViewCell.Template" Value="{StaticResource cellTemplate}" /> 
                    </Style> 
                    </telerik:RadGridView.Resources> 

 <telerik:RadGridView.Columns> 
                        <telerik:GridViewDataColumn UniqueName="Add" Header="" Width="Auto" CellStyle="{StaticResource booleanCellStyle}"/>  
                     

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 12 Aug 2009, 08:13 AM
Hello Orit,

Here is an example how to achieve this:
        <telerik:RadGridView  Name="RadGridView1"
            <telerik:RadGridView.Resources> 
                <ControlTemplate x:Key="cellTemplate" TargetType="{x:Type telerik:GridViewCell}"
                    <Border BorderBrush="DarkGray" BorderThickness="0,0,1,1"
 
                        <CheckBox IsChecked="{Binding Field.Record.Data.Add, RelativeSource={RelativeSource TemplatedParent}}"    
                                                    HorizontalAlignment="Center" VerticalAlignment="Center" /> 
                    </Border> 
                </ControlTemplate> 
                <Style x:Key="booleanCellStyle"
                    <Setter Property="telerik:GridViewCell.Template" Value="{StaticResource cellTemplate}" /> 
                </Style> 
            </telerik:RadGridView.Resources> 
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn UniqueName="Add" Header="" Width="Auto" CellStyle="{StaticResource booleanCellStyle}"/> 
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 


Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Orit
Top achievements
Rank 1
answered on 12 Aug 2009, 08:19 AM
Thank You! It works fine.
Tags
GridView
Asked by
Orit
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Orit
Top achievements
Rank 1
Share this question
or