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

Not able to set GridViewToggleButton style

0 Answers 63 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pravin
Top achievements
Rank 1
Pravin asked on 16 Apr 2012, 03:16 PM
Hi,
I would like to change the +/- symbol on a GridViewToggleRowDetailsColumn so i have created below ControlTemplate

<ControlTemplate x:Key="GridViewToggleButtonTemplate" TargetType="telerik:GridViewToggleButton">
                   <Border Background="Transparent" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                       <Border Width="80" Height="20"
                   Background="{TemplateBinding Background}"
                   BorderBrush="{TemplateBinding BorderBrush}"                
                   BorderThickness="{TemplateBinding BorderThickness}"
                   VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                   HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                           <Grid x:Name="myGrid">
                               <TextBlock Text="Details" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                           </Grid>
                       </Border>
                   </Border>
                   <ControlTemplate.Triggers>
                       <Trigger Property="IsChecked" Value="True">
                           <Setter TargetName="myGrid" Property="Background" Value="Red" />
                       </Trigger>
                   </ControlTemplate.Triggers>
 
               </ControlTemplate>
 
               <Style TargetType="telerik:GridViewToggleButton" x:Key="toggleButtonStyle">
                   <Setter Property="Template" Value="{StaticResource GridViewToggleButtonTemplate}" />
               </Style>

And applied this style in telerik:RadGridView.Columns as below
<telerik:GridViewToggleRowDetailsColumn ToggleButtonStyle="{StaticResource toggleButtonStyle}" />

But this doesn't work so please let know how do i fix this problem.
Thanks in advance.
Tags
GridView
Asked by
Pravin
Top achievements
Rank 1
Share this question
or