I have followed the following example, where I have replaced the default view only GridViewCheckBoxTemplate with my own, in the resource dictionary:
http://docs.telerik.com/devtools/silverlight/controls/radgridview/styles-and-templates/columns-styling-checkboxcolumn.html
This works well, because it automatically fixed all of our grids, without me having to do anything else. The problem is that I cannot figure out how to do the same for the Check Box in edit mode. No matter what I try, it always ends up just being the standard CheckBox.
I have been through all of the documentation and every forum that I can find and nothing is getting me closer to this goal: I would like to find the place where the Telerik GridViewCheckBoxColumn says that it is going to use CheckBox as it's cell edit template and give the name of a new style I create, which is based on CheckBox but looks like my GridViewCheckBoxTemplate does. This way everyone who uses GridViewCheckBoxColumn will automatically get this.
I have been through every piece of documentation and forum thread I can find and nothing is helping me figure out how to deal with the edit mode look from GridViewCheckBoxColumn. Does anyone have an example I can follow? I am fairly new to templating and styling, so the more specific the better.
Here is the code for the control on my screen:
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn MinWidth="200"
DataMemberBinding="{Binding Label}"
Header="Medical"
IsReadOnly="True" />
<telerik:GridViewCheckBoxColumn MinWidth="80"
AutoSelectOnEdit="True"
CellStyle="{StaticResource CenterCheckBox}"
DataMemberBinding="{Binding Answer}"
EditTriggers="CellClick"
Header="Check If Yes"
IsReadOnly="{Binding MedicalSelected.CannotCheckBox}" />
</telerik:RadGridView.Columns>
And here is the code from my GridViewCheckBoxTemplate:
<ControlTemplate x:Key="GridViewCheckBoxTemplate"
TargetType="teleriktest:GridViewCheckBox">
<Grid Width="17"
Height="17"
Margin="0,0,3,0"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
<Storyboard>
<ObjectAnimationUsingKeyFrames BeginTime="0"
Duration="0"
Storyboard.TargetName="CheckedPath"
Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0"
Value="Visible" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
<VisualState x:Name="Indeterminate">
<Storyboard>
<ObjectAnimationUsingKeyFrames BeginTime="0"
Duration="0"
Storyboard.TargetName="IndeterminatePath"
Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0"
Value="Visible" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border Background="#FFEEEEEE"
BorderBrush="#FFB9B9B9"
BorderThickness="1,1,1,1"
CornerRadius="1">
<Grid Margin="2">
<Path x:Name="IndeterminatePath"
Width="9"
Height="9"
Margin="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M14.708333,144.5 L20.667,144.5"
Stretch="Fill"
Stroke="#FF4C4C4C"
StrokeThickness="2.0"
Visibility="Collapsed" />
<Path x:Name="CheckedPath"
Margin="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M32.376187,77.162509 L35.056467,80.095277 40.075451,70.02144"
Stretch="Fill"
Stroke="#FF4C4C4C"
StrokeThickness="2.0"
Visibility="Collapsed" />
</Grid>
</Border>
</Grid>
</ControlTemplate>
<Style x:Key="GridViewCheckBoxStyle"
TargetType="teleriktest:GridViewCheckBox">
<Setter Property="Template" Value="{StaticResource GridViewCheckBoxTemplate}" />
</Style>
<Style TargetType="teleriktest:GridViewCheckBox"
BasedOn="{StaticResource GridViewCheckBoxStyle}"/>