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

Not able to set GridViewToggleButton style

0 Answers 41 Views
GridView
This is a migrated thread and some comments may be shown as answers.
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.

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Pravin
Top achievements
Rank 1
Share this question
or