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

GridViewCheckBox style

1 Answer 145 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nick Anderson
Top achievements
Rank 1
Nick Anderson asked on 21 Sep 2010, 08:25 PM
I am trying to style the GridViewCheckBox in my application, but I can't seem to get the GridViewCheckBox style to take effect. I would like to show the CheckBox without a box around it (just the check or no check).

Using Blend, this is what I got for a style:
<ResourceDictionary
    <!-- Resource dictionary entries should be defined here. -->
    <Style TargetType="{x:Type telerik:GridViewCheckBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:GridViewCheckBox}">
                    <Grid HorizontalAlignment="Left" VerticalAlignment="Center" Width="13" Height="13">
                        <Grid Margin="0">
                            <Path x:Name="IndeterminatePath" Stretch="Fill" Stroke="#FF8D8D8D" StrokeThickness="1.5" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="7" Height="7" Visibility="Collapsed" Data="M14.708333,144.5L20.667,144.5"/>
                            <Path x:Name="CheckedPath" Stretch="Fill" Stroke="#FF8D8D8D" StrokeThickness="1.5" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Visibility="Collapsed" Data="M32.376187,77.162509L35.056467,80.095277 40.075451,70.02144"/>
                        </Grid>                             
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Visibility" TargetName="CheckedPath" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsThreeState" Value="True">
                            <Setter Property="Visibility" TargetName="IndeterminatePath" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>

I also see there is a class for the GridViewCheckBoxColumn, but I have been unsuccessful in changing the style template of that either.

How can I style the checkbox?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 22 Sep 2010, 02:07 PM
Hi Nick Anderson,

Attached is a sample project that shows how to modify the GridViewCheckBox,that shows only the tick mark without any borders around it.
Just to mention that when the GridViewCheckBox goes into edit mode,the EditorStyle property of the GridViewCheckBox column defines the appearance of the GridViewCheckBox.
It would also suggest you to see the following thread and if you need any further assistance please let me know.

Sincerely yours,
Vanya Pavlova
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
Tags
GridView
Asked by
Nick Anderson
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or