This question is locked. New answers and comments are not allowed.
Hi there
I've got a RadGridView, with a RowStyle generated by going to Object > Edit other Styles > Edit Rowstyle > Edit a Copy..
I've modified it in Blend by manually changing the XAML values of backgrounds etc... in the actual Style definition, but these don't visually change in Blend.
Then, if I manually change the background colour of the PART_IndicatorPresenter you can see this colour coming through in Blend, but when I run it, it still looks exactly like the default control (grey with orange mouseovers). What am I missing?
Here is my ugly XAML:
I've got a RadGridView, with a RowStyle generated by going to Object > Edit other Styles > Edit Rowstyle > Edit a Copy..
I've modified it in Blend by manually changing the XAML values of backgrounds etc... in the actual Style definition, but these don't visually change in Blend.
Then, if I manually change the background colour of the PART_IndicatorPresenter you can see this colour coming through in Blend, but when I run it, it still looks exactly like the default control (grey with orange mouseovers). What am I missing?
Here is my ugly XAML:
| <UserControl.Resources> |
| <DesignTimeData:ListGridData x:Key="ListGridDataDS" d:IsDataSource="True"/> |
| <Color x:Key="GridViewRowMouseOverColorStop1">#FF81D821</Color> |
| <Color x:Key="GridViewRowMouseOverColorStop2">#FF58AF17</Color> |
| <LinearGradientBrush x:Key="GridViewRowHoveredBackground" EndPoint="0.5,1" StartPoint="0.5,0"> |
| <GradientStop Color="{StaticResource GridViewRowMouseOverColorStop1}" Offset="1"/> |
| <GradientStop Color="#FF58AF17" Offset="0"/> |
| </LinearGradientBrush> |
| <Color x:Key="GridViewElementSelectedColorStop2">#FF3DF3DA</Color> |
| <Color x:Key="GridViewElementSelectedColorStop1">#FF18C4AC</Color> |
| <LinearGradientBrush x:Key="GridViewRowSelectedBackground" EndPoint="0.5,1" StartPoint="0.5,0"> |
| <GradientStop Color="{StaticResource GridViewElementSelectedColorStop2}" Offset="1"/> |
| <GradientStop Color="#FFC7F9F2" Offset="0"/> |
| </LinearGradientBrush> |
| <ControlTemplate x:Key="GridViewRowTemplate" TargetType="telerikGridViewControls:GridViewRow"> |
| <Grid x:Name="grid"> |
| <vsm:VisualStateManager.VisualStateGroups> |
| <vsm:VisualStateGroup x:Name="FocusStates"> |
| <vsm:VisualState x:Name="Unfocused"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NavigatorIndicator" Storyboard.TargetProperty="Visibility"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| <vsm:VisualState x:Name="Focused"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NavigatorIndicator" Storyboard.TargetProperty="Visibility"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| </vsm:VisualStateGroup> |
| <vsm:VisualStateGroup x:Name="SelectionStates"> |
| <vsm:VisualState x:Name="Unselected"/> |
| </vsm:VisualStateGroup> |
| <vsm:VisualStateGroup x:Name="CommonStates"> |
| <vsm:VisualState x:Name="Normal"/> |
| <vsm:VisualState x:Name="MouseOver"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectionBackground" Storyboard.TargetProperty="Background"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridViewRowHoveredBackground}"/> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| <vsm:VisualState x:Name="Selected"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectionBackground" Storyboard.TargetProperty="Background"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridViewRowSelectedBackground}"/> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| </vsm:VisualStateGroup> |
| <vsm:VisualStateGroup x:Name="ValueStates"> |
| <vsm:VisualState x:Name="Valid"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InvalidBorder" Storyboard.TargetProperty="Visibility"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| <vsm:VisualState x:Name="Invalid"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InvalidBorder" Storyboard.TargetProperty="Visibility"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| </vsm:VisualStateGroup> |
| </vsm:VisualStateManager.VisualStateGroups> |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition Width="Auto"/> |
| <ColumnDefinition Width="Auto"/> |
| <ColumnDefinition Width="Auto"/> |
| </Grid.ColumnDefinitions> |
| <Border Margin="{TemplateBinding Margin}" MinHeight="{TemplateBinding MinHeight}" x:Name="SelectionBackground" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.Column="2"/> |
| <telerikGridViewControls:IndicatorPresenter x:Name="PART_IndicatorPresenter" Visibility="{TemplateBinding RowIndicatorVisibility}" Background="#FF3193F5" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,0,1,1" Grid.Column="0"> |
| <Path Height="8" Margin="7,0,0,0" x:Name="NavigatorIndicator" Width="5" Visibility="Collapsed" Data="M254.5,183.75 L254.5,193.33333 260.75,188.16682 z" Fill="#FF000000" Stretch="Fill"/> |
| </telerikGridViewControls:IndicatorPresenter> |
| <telerikGridViewControls:IndentPresenter x:Name="PART_IndentPresenter" Background="{TemplateBinding Background}" Grid.Column="1" IndentLevel="{TemplateBinding IndentLevel}" /> |
| <telerikGridViewControls:DataCellsPresenter Height="Auto" MinHeight="{TemplateBinding MinHeight}" x:Name="PART_DataCellsPresenter" Background="#FFF79797" Grid.Column="2"/> |
| <Rectangle Height="Auto" Margin="0" x:Name="InvalidBorder" Width="Auto" Visibility="Collapsed" Grid.Column="0" Grid.ColumnSpan="3" Stroke="Red" StrokeThickness="2"/> |
| </Grid> |
| </ControlTemplate> |
| <Style x:Key="GridViewRowStyle1" TargetType="telerikGridViewControls:GridViewRow"> |
| <Setter Property="IsTabStop" Value="False"/> |
| <Setter Property="Template" Value="{StaticResource GridViewRowTemplate}"/> |
| <Setter Property="Background" Value="#FF6EF3EE"/> |
| <Setter Property="BorderBrush"> |
| <Setter.Value> |
| <SolidColorBrush Color="#FFF98C17"/> |
| </Setter.Value> |
| </Setter> |
| <Setter Property="BorderThickness" Value="3"/> |
| <Setter Property="MinHeight" Value="24"/> |
| <Setter Property="FontSize" Value="11"/> |
| <Setter Property="FontWeight" Value="Normal"/> |
| <Setter Property="Margin" Value="0"/> |
| <Setter Property="Padding" Value="0"/> |
| <Setter Property="Foreground" Value="#FF000000"/> |
| </Style> |
| </UserControl.Resources> |
| <Grid x:Name="LayoutRoot" Background="White"> |
| <telerikGridView:RadGridView ShowColumnHeaders="True" AutoGenerateColumns="True" CanUserResizeColumns="False" CanUserReorderColumns="False" IsFilteringAllowed="False" ShowGroupPanel="False" ItemsSource="{Binding Mode=OneWay, Path=GridData, Source={StaticResource ListGridDataDS}}" RowIndicatorVisibility="Collapsed" AlternateRowStyle="{StaticResource GridViewRowStyle1}" RowStyle="{StaticResource GridViewRowStyle1}" > |
| <telerikGridView:RadGridView.RowAppearance> |
| <telerikGridView:RowAppearanceSettings UseAlternateRowStyle="False"/> |
| </telerikGridView:RadGridView.RowAppearance> |
| </telerikGridView:RadGridView> |
| </Grid> |
| </UserControl> |