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

RadGridView throws exception when using 'Metro' theme and applying filter

5 Answers 256 Views
GridView
This is a migrated thread and some comments may be shown as answers.
clinton@clintoncherry.com
Top achievements
Rank 1
clinton@clintoncherry.com asked on 23 Aug 2011, 08:43 AM
I have setup a basic RadGridView in WPF, and applied the metro theme to it.

When I try and apply a filter to any column in the GridView it throws a DynamicResourceExtension error the second time the filter is selected.
This ONLY happens when using the Metro UI theme on the RadGridView and happens in several examples that I tested this on.

The basic error message thrown is:
{"A 'DynamicResourceExtension' cannot be set on the 'BasedOn' property of type 'Style'. A 'DynamicResourceExtension' can only be set on a DependencyProperty of a DependencyObject."}

5 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 23 Aug 2011, 09:42 AM
Hello Clinton,

 

I have tried to reproduce the behavior you described but I was not able to. May you please check the attached project and let me know how it differs from yours? Any additional information about the grid version you used would be highly appreciated as well. 



Best wishes,
Vanya Pavlova
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
clinton@clintoncherry.com
Top achievements
Rank 1
answered on 23 Aug 2011, 10:09 AM
Thanks for the prompt reply Vanya.
I don't seem to be able to upload my project however I am using the latest controls version 2011.2.712.35
The issue seems to come from my app.xaml file - in here I dynamically add the Metro theme to the controls.

As I can't upload my entire project here is a copy of the content of the app.xaml:

<Application x:Class="RadGridView.MetroFilterError.Example.App"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             StartupUri="MainWindow.xaml"
             xmlns:telerikChromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls,Version=2011.2.0712.35,Culture=neutral,PublicKeyToken=5803cfa389c90ce7" 
             xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"  >
  
    <Application.Resources>
  
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        <telerik:InvertedBooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverter" />
  
        <telerik:Theme x:Key="TelerikGlobalTheme">Metro</telerik:Theme>
        <telerik:Theme x:Key="TelerikGlobalThemeOther">Expression_Dark</telerik:Theme>
  
        <SolidColorBrush x:Key="ControlTextForegroundBrush" Color="White"/>
        <SolidColorBrush x:Key="ControlTextBoxForegroundBrush" Color="#FF434343"/>
        <SolidColorBrush x:Key="ListBoxForegroudColorBrush" Color="#FF313131"/>
        <SolidColorBrush x:Key="ApplicationBackgroundBrush" Color="#FF222222"/>
        <SolidColorBrush x:Key="RadGridViewHeaderStyle" Color="#FFCECECE"/>
        <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
        <SolidColorBrush x:Key="PrimaryFontColorBrush" Color="Silver"/>
        <SolidColorBrush x:Key="PrimaryFontColorBrushDark" Color="#FF434343"/>
        <SolidColorBrush x:Key="SelectedItemColor" Color="#FF119eda"/>
        <SolidColorBrush x:Key="PrimaryColorBrush1" Color="#FF119eda"/>
        <SolidColorBrush x:Key="PrimaryColorBrush2" Color="#FF8ab801"/>
        <SolidColorBrush x:Key="FormBackgroundBrushSolid" Color="#FF434343"/>
        <LinearGradientBrush x:Key="FormBackgroundBrushLight">
            <GradientStop Color="#FF878787" Offset="1" />
            <GradientStop Color="#FFCACACA" />
        </LinearGradientBrush>
        <SolidColorBrush x:Key="InvalidControlBrush" Color="#E5B8B7"/>
  
        <SolidColorBrush x:Key="CheckBoxFillNormal" Color="#F4F4F4"/>
        <SolidColorBrush x:Key="CheckBoxStroke" Color="#8E8F8F"/>
        <SolidColorBrush x:Key="DisabledControlFill" Color="#FF454545"/>
        <SolidColorBrush x:Key="DisabledControlStroke" Color="#FF767676"/>
  
        <LinearGradientBrush x:Key="TimeRulerBackgroundBrush">
            <GradientStop Color="#FFCBDAEE" Offset="0" />
            <GradientStop Color="#FFD8E6FE" Offset="1" />
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
            <GradientStop Color="#F3F3F3" Offset="0"/>
            <GradientStop Color="#EBEBEB" Offset="0.5"/>
            <GradientStop Color="#DDDDDD" Offset="0.5"/>
            <GradientStop Color="#CDCDCD" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="OkForegroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF007F15" Offset="0"/>
            <GradientStop Color="#FF015A10" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="OkForeGroundHoverBrush" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF00580F" Offset="0"/>
            <GradientStop Color="#FF002D08" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="ButtonPanelBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF6F6F6F" Offset="0"/>
            <GradientStop Color="#FF5A5A5A" Offset="1"/>
        </LinearGradientBrush>
  
        <LinearGradientBrush x:Key="FormBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF434343" Offset="0"/>
            <GradientStop Color="#FF3D3D3D" Offset="1"/>
        </LinearGradientBrush>
  
        <DataTemplate x:Key="ErrorMessageTemplate">
            <StackPanel>
                <TextBlock Text="{Binding}"/>
            </StackPanel>
        </DataTemplate>
  
        <ItemsPanelTemplate x:Key="ListBoxItemsPanelStyle">
            <VirtualizingStackPanel IsItemsHost="True" Background="#FFC7C7C7"/>
        </ItemsPanelTemplate>
  
  
        <Style x:Key="SliderSettingsStyle" TargetType="{x:Type Slider}">
            <Setter Property="Interval" Value="1" />
            <Setter Property="SelectionStart" Value="0" />
            <Setter Property="SelectionEnd" Value="365" />
            <Setter Property="Ticks" Value="10" />
            <Setter Property="TickFrequency" Value="30" />
            <Setter Property="IsSnapToTickEnabled" Value="True" />
            <Setter Property="IsDirectionReversed" Value="False" />
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="50"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Slider     Grid.Column="0" SelectionStart="0"
                                    SelectionEnd="{Binding Path=Maximum, Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
                                    x:Name="SliderTemplate"
                                    Value="{Binding Path=Value, Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
                                    VerticalAlignment="Top" 
                                    Maximum="{Binding Path=Maximum, Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" Interval="1" 
                                    IsDirectionReversed="False" IsSnapToTickEnabled="True" />
                            <TextBox Text="{Binding ElementName=SliderTemplate, Path=Value, Mode=TwoWay}" Margin="5" Grid.Column="1" Width="40" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
  
        <Style x:Key="HeadingMain" TargetType="TextBlock">
            <Setter Property="FontSize" Value="30"/>
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontStyle" Value="Normal"/>
            <Setter Property="FontWeight" Value="ExtraLight"/>
            <Setter Property="TextAlignment" Value="Left"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Margin" Value="40,0,0,10"  />
        </Style>
        <Style x:Key="SubHeadingMain" TargetType="TextBlock">
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontStyle" Value="Normal"/>
            <Setter Property="FontWeight" Value="ExtraLight"/>
            <Setter Property="TextAlignment" Value="Left"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Margin" Value="10,0,0,10"  />
        </Style>
  
        <Style x:Key="FormLabelStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="TextWrapping" Value="NoWrap"/>
            <Setter Property="TextTrimming" Value="None"/>
            <Setter Property="Foreground" Value="{DynamicResource PrimaryFontColorBrush}"/>
            <Setter Property="Margin" Value="4"/>
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="MinWidth" Value="100"/>
            <Setter Property="TextAlignment" Value="Right"/>
        </Style>
        <Style x:Key="ButtonFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleGeneral" TargetType="{x:Type Button}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
            <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
            <Setter Property="BorderBrush" Value="#FF222222"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="Width" Value="75"/>
            <Setter Property="Margin" Value="4"/>
            <Setter Property="DockPanel.Dock" Value="Right"/>
            <Setter Property="Height" Value="30"/>
            <Setter Property="Foreground" Value="#FF222222"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" RenderMouseOver="{TemplateBinding IsMouseOver}" 
                                                               RenderPressed="{TemplateBinding IsPressed}" RenderDefaulted="{TemplateBinding IsDefaulted}"
                                                               SnapsToDevicePixels="true" Background="{TemplateBinding Background}">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" 
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Microsoft_Windows_Themes:ButtonChrome>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
                                <Setter Property="Background" TargetName="Chrome" Value="{DynamicResource SelectedItemColor}"/>
                                <Setter Property="Foreground" Value="{DynamicResource ControlTextForegroundBrush}"/>
                            </Trigger>
                            <Trigger Property="ToggleButton.IsChecked" Value="true">
                                <Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
                                <Setter Property="Foreground" Value="{DynamicResource ControlTextForegroundBrush}"/>
                                <Setter Property="Background" TargetName="Chrome" Value="{DynamicResource SelectedItemColor}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="#ADADAD"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleOk" TargetType="{x:Type Button}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
            <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
            <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
            <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Foreground" Value="#FFFFFFFF"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="Width" Value="75"/>
            <Setter Property="Margin" Value="4"/>
            <Setter Property="DockPanel.Dock" Value="Right"/>
            <Setter Property="Height" Value="30"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RenderDefaulted="{TemplateBinding IsDefaulted}" SnapsToDevicePixels="true" Background="{DynamicResource OkForegroundBrush}">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Microsoft_Windows_Themes:ButtonChrome>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
                            </Trigger>
                            <Trigger Property="ToggleButton.IsChecked" Value="true">
                                <Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="#ADADAD"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonPanelStyle" TargetType="{x:Type DockPanel}" >
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Height" Value="60"/>
            <Setter Property="Margin" Value="0"/>
            <Setter Property="LastChildFill" Value="False"/>
            <Setter Property="Background" Value="{StaticResource ButtonPanelBackgroundBrush}"/>
        </Style>
        <Style x:Key="GeneralTextStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="TextWrapping" Value="NoWrap"/>
            <Setter Property="TextTrimming" Value="None"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Margin" Value="4"/>
        </Style>
        <Style x:Key="ErrorMessageBox" TargetType="{x:Type TextBlock}">
            <Setter Property="TextWrapping" Value="Wrap"/>
            <Setter Property="Width" Value="400"/>
            <Setter Property="MinHeight" Value="50"/>
            <Setter Property="Foreground" Value="Red"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="Margin" Value="4"/>
            <Setter Property="Padding" Value="4"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Stretch"/>
            <Setter Property="Background" Value="#FFF1B6B6"/>
            <Setter Property="TextTrimming" Value="WordEllipsis"/>
            <Style.Triggers>
                <Trigger Property="Text" Value="">
                    <Setter Property="Visibility" Value="Collapsed" />
                </Trigger>
                <Trigger Property="Text" Value="{x:Null}">
                    <Setter Property="Visibility" Value="Collapsed" />
                </Trigger>
                <Trigger Property="Visibility" Value="Visible">
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="00:00:00" BeginTime="00:00:00" From="0.0" To="1.0" />
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>
                </Trigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="SuccessMessageBox" TargetType="{x:Type TextBlock}">
            <Setter Property="TextWrapping" Value="Wrap"/>
            <Setter Property="Width" Value="400"/>
            <Setter Property="MinHeight" Value="50"/>
            <Setter Property="Foreground" Value="Green"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="Background" Value="#FFD7F3D7"/>
            <Setter Property="Margin" Value="4"/>
            <Setter Property="Padding" Value="4"/>
            <Setter Property="HorizontalAlignment" Value="Stretch"/>
            <Setter Property="TextAlignment" Value="Center"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="TextTrimming" Value="WordEllipsis"/>
            <Style.Triggers>
                <Trigger Property="Text" Value="">
                    <Setter Property="Visibility" Value="Collapsed" />
                </Trigger>
                <Trigger Property="Text" Value="{x:Null}">
                    <Setter Property="Visibility" Value="Collapsed" />
                </Trigger>
                <Trigger Property="Visibility" Value="Visible">
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="00:00:00" BeginTime="00:00:00" From="0.0" To="1.0" />
                                <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="00:00:03" BeginTime="00:00:10" From="1.0" To="0.0" />
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>
                </Trigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="LayoutMainStyle" TargetType="{x:Type StackPanel}">
            <Setter Property="Margin" Value="10"/>
            <Setter Property="Background" Value="{DynamicResource FormBackgroundBrush}"/>
            <Setter Property="VerticalAlignment" Value="Top"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="UseLayoutRounding" Value="True"/>
            <Setter Property="MinWidth" Value="450"/>
            <Setter Property="Width" Value="750"/>
            <Setter Property="MaxWidth" Value="750"/>
            <Setter Property="MinHeight" Value="650"/>
        </Style>
        <Style x:Key="LayoutDockedStyle" TargetType="{x:Type DockPanel}">
            <Setter Property="Margin" Value="10"/>
            <Setter Property="Background" Value="{DynamicResource FormBackgroundBrush}"/>
            <Setter Property="VerticalAlignment" Value="Top"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="UseLayoutRounding" Value="True"/>
            <Setter Property="MinWidth" Value="450"/>
            <Setter Property="Width" Value="750"/>
            <Setter Property="MinHeight" Value="650"/>
        </Style>
        <Style x:Key="HelpTextStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="TextWrapping" Value="NoWrap"/>
            <Setter Property="TextTrimming" Value="None"/>
            <Setter Property="Foreground" Value="{DynamicResource PrimaryFontColorBrush}"/>
            <Setter Property="Margin" Value="4"/>
        </Style>
  
        <Style TargetType="{x:Type telerik:RadMaskedTextInput}">
            <Setter Property="Margin" Value="4"/>
            <Setter Property="IsClearButtonVisible" Value="False"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="Local"/>
            <Setter Property="MinWidth" Value="200"/>
            <Setter Property="TextMode" Value="PlainText"/>
            <Setter Property="ErrorMessageTemplate" Value="{DynamicResource ErrorMessageTemplate}"/>
            <Setter Property="Placeholder" Value=" "/>
            <Setter Property="Mask" Value="a255"/>
            <!--<Setter Property="SelectionOnFocus" Value="SelectAll"/>-->
            <!--<Setter Property="UpdateValueEvent" Value="LostFocus"/>-->
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style TargetType="{x:Type telerik:RadMaskedNumericInput}">
            <Setter Property="Margin" Value="4"/>
            <Setter Property="IsClearButtonVisible" Value="False"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="Local"/>
            <Setter Property="MinWidth" Value="100"/>
            <Setter Property="TextMode" Value="PlainText"/>
            <Setter Property="ErrorMessageTemplate" Value="{DynamicResource ErrorMessageTemplate}"/>
            <Setter Property="Placeholder" Value=" "/>
            <Setter Property="Mask" Value="ddd"/>
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style TargetType="{x:Type telerik:RadMaskedDateTimeInput}">
            <Setter Property="Margin" Value="4"/>
            <Setter Property="IsClearButtonVisible" Value="False"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="Local"/>
            <Setter Property="MinWidth" Value="100"/>
            <Setter Property="TextMode" Value="PlainText"/>
            <Setter Property="ErrorMessageTemplate" Value="{DynamicResource ErrorMessageTemplate}"/>
            <Setter Property="Placeholder" Value=" "/>
            <Setter Property="Mask" Value="t"/>
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style x:Key="FormIntroTextStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="TextWrapping" Value="Wrap"/>
            <Setter Property="TextTrimming" Value="None"/>
            <Setter Property="Margin" Value="45,4,4,15"/>
            <Setter Property="Foreground" Value="#FFD2D2D2"/>
            <Setter Property="FontSize" Value="13"/>
            <Setter Property="FontFamily" Value="Segoe UI Light"/>
        </Style>
        <Style x:Key="FormElementStyle" TargetType="FrameworkElement">
            <Setter Property="Margin" Value="10, 10, 0, 2" />
        </Style>
        <Style x:Key="FormNumberElementStyle" TargetType="TextBox">
            <Setter Property="MinWidth" Value="30" />
            <Setter Property="MaxLength" Value="3" />
            <Setter Property="Margin" Value="10, 10, 0, 2" />
        </Style>
        <Style x:Key="FormElementTextBlockStyle" TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Right" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Margin" Value="15, 15, 0, 2" />
        </Style>
        <Style x:Key="TimeRulerStyle" TargetType="Border">
            <Setter Property="Background" Value="{StaticResource TimeRulerBackgroundBrush}" />
            <Setter Property="Width" Value="75" />
        </Style>
  
        <!-- Must specify for all control types to force a dynamic theme update -->
        <Style BasedOn="{x:Null}" TargetType="{x:Type Button}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type ComboBox}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type Expander}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type GroupBox}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type Label}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
  
        <Style BasedOn="{x:Null}" TargetType="{x:Type ListView}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type Menu}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type PasswordBox}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type ProgressBar}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type RadioButton}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type RichTextBox}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type ScrollBar}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type ScrollViewer}">
            <Setter Property="Background" Value="#FF222222" />
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type Slider}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type Separator}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type StatusBar}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type TabControl}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
  
        <Style BasedOn="{x:Null}" TargetType="{x:Type ToolBar}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type ToolBarPanel}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type ToolBarTray}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type TreeView}">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <!-- This allows for dynamic changing of themes -->
        <!-- Docking -->
        <Style BasedOn="{x:Null}" TargetType="telerik:RadDocking">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
            <Setter Property="Background" Value="Transparent"/>
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadSplitContainer">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <!-- Scheduler -->
        <Style BasedOn="{x:Null}" TargetType="telerik:RadSlider">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
         
        <Style BasedOn="{x:Null}" TargetType="telerik:RadGridView">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
            <!--This is temporarily set to Windows7 as the Metro theme throws issues when applying a filter to this control-->
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadButton">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadDropDownButton">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadRadioButton">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadSplitButton">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadToggleButton">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadExpander">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadWrapPanel">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadCalendar">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadColorPaletteView">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadColorPaletteViewItem">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadColorPicker">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadColorSelector">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadComboBox">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadComboBoxItem">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadDatePicker">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadMaskedTextBox">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadNumericUpDown">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadClock">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadTimePicker">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style BasedOn="{x:Null}" TargetType="telerik:RadTreeListView">
            <Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        <Style x:Key="ListBoxItemTextBoxStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="TextWrapping" Value="NoWrap"/>
            <Setter Property="TextTrimming" Value="None"/>
            <Setter Property="Margin" Value="4"/>
            <Setter Property="Width" Value="200"/>
            <Setter Property="HorizontalAlignment" Value="Stretch"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Foreground" Value="{StaticResource ListBoxForegroudColorBrush}"/>
        </Style>
        <Style x:Key="ListBoxItemStackPanelStyle" TargetType="{x:Type StackPanel}">
            <Setter Property="Margin" Value="2"/>
            <Setter Property="Orientation" Value="Horizontal"/>
            <Setter Property="HorizontalAlignment" Value="Stretch"/>
        </Style>
        <Style x:Key="ListBoxItemStyleMain" TargetType="{x:Type ListBoxItem}">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
            <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
            <Setter Property="Padding" Value="2,0,0,0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
                        <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" 
                                Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected" Value="true">
                                <Setter Property="Background" TargetName="Bd" Value="{DynamicResource SelectedItemColor}"/>
                                <Setter Property="Foreground" Value="{DynamicResource ControlTextForegroundBrush}"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true"/>
                                    <Condition Property="Selector.IsSelectionActive" Value="false"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="Bd" Value="{DynamicResource SelectedItemColor}"/>
                                <Setter Property="Foreground" Value="{DynamicResource ControlTextForegroundBrush}"/>
                            </MultiTrigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style BasedOn="{DynamicResource ListBoxItemStyleMain}" TargetType="{x:Type ListBoxItem}"/>
        <Style BasedOn="{x:Null}" TargetType="{x:Type ListBox}">
            <Setter Property="ItemContainerStyle" Value="{DynamicResource ListBoxItemStyleMain}" />
            <Setter Property="ItemsPanel" Value="{DynamicResource ListBoxItemsPanelStyle}" />
            <Setter Property="Margin" Value="4" />
            <Setter Property="Width" Value="410" />
            <Setter Property="HorizontalAlignment" Value="Stretch"/>
            <Setter Property="Foreground" Value="{DynamicResource ControlTextForegroundBrush}" />
            <!--<Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />-->
            <Style.Triggers>
                <DataTrigger  Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Items.Count}"  Value="0">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <TextBlock FontStyle="Italic" Foreground="White">No current items</TextBlock>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <!-- Doesnt work.
        <Style BasedOn="{x:Null}" TargetType="telerik:StyleManager">
            <Setter Property="ApplicationTheme" Value="{DynamicResource TelerikGlobalTheme}" />
        </Style>
        -->
        <ControlTemplate x:Key="ListBoxItemButton" TargetType="{x:Type Button}">
            <Grid Margin="4" Width="75" Height="30">
                <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                        Background="{TemplateBinding Background}"/>
                <Grid x:Name="ContentGrid">
                    <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" 
                                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" 
                                      RecognizesAccessKey="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </Grid>
                <Border x:Name="CommonStatesWrapper">
                    <Border x:Name="FocusVisual" BorderThickness="1" Opacity="0" Visibility="Collapsed">
                        <Border.BorderBrush>
                            <SolidColorBrush Color="{Binding Palette.MarkerColor}"/>
                        </Border.BorderBrush>
                    </Border>
                </Border>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" TargetName="Border" Value="{DynamicResource ControlTextForegroundBrush}"/>
                    <Setter Property="Background" TargetName="ContentGrid" Value="{DynamicResource SelectedItemColor}"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="Opacity" TargetName="CommonStatesWrapper" Value="0"/>
                    <Setter Property="Background" TargetName="Border" Value="{DynamicResource ControlTextForegroundBrush}"/>
                    <Setter Property="Background" TargetName="ContentGrid" Value="{DynamicResource SelectedItemColor}"/>
                    <Setter Property="Margin" TargetName="ContentGrid" Value="0,0,0,-1"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Opacity" TargetName="Content" Value="0.5"/>
                    <Setter Property="Opacity" TargetName="Border" Value="0.5"/>
                </Trigger>
                <Trigger Property="IsFocused" Value="True">
                    <Setter Property="Visibility" TargetName="FocusVisual" Value="Visible"/>
                    <Setter Property="Opacity" TargetName="FocusVisual" Value="1"/>
                    <Setter Property="Background" TargetName="Border" Value="{DynamicResource ControlTextForegroundBrush}"/>
                    <Setter Property="Background" TargetName="ContentGrid" Value="{DynamicResource SelectedItemColor}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <Style x:Key="EmptyCheckBoxFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="1" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" 
                                   StrokeThickness="1" StrokeDashArray="1 2"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="CheckRadioFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" 
                                   StrokeThickness="1" StrokeDashArray="1 2"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style BasedOn="{x:Null}" TargetType="{x:Type CheckBox}" x:Key="CheckBoxStyleMain">
            <!--x:Key="CheckBoxStyleMain"-->
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="Background" Value="{StaticResource CheckBoxFillNormal}"/>
            <Setter Property="BorderBrush" Value="{StaticResource CheckBoxStroke}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="FocusVisualStyle" Value="{StaticResource EmptyCheckBoxFocusVisual}"/>
            <!--<Setter Property="telerik:StyleManager.Theme" Value="{DynamicResource TelerikGlobalTheme}" />-->
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type CheckBox}">
                        <BulletDecorator Background="Transparent" SnapsToDevicePixels="true">
                            <BulletDecorator.Bullet>
                                <Microsoft_Windows_Themes:BulletChrome x:Name="bulletChrome" BorderBrush="{TemplateBinding BorderBrush}" 
                                                                       Background="{TemplateBinding Background}" IsChecked="{TemplateBinding IsChecked}" 
                                                                       RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}"/>
                            </BulletDecorator.Bullet>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" 
                                              RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </BulletDecorator>
                        <ControlTemplate.Triggers>
                            <Trigger Property="HasContent" Value="true">
                                <Setter Property="FocusVisualStyle" Value="{StaticResource CheckRadioFocusVisual}"/>
                                <Setter Property="Padding" Value="4,0,0,0"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                                <Setter Property="BorderBrush" TargetName="bulletChrome" Value="{DynamicResource DisabledControlStroke}"/>
                                <Setter Property="Background" TargetName="bulletChrome" Value="{DynamicResource DisabledControlFill}"/>
                                <Setter Property="Opacity" TargetName="bulletChrome" Value="0.495"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
  
  
  
    </Application.Resources>
  
</Application>
0
Vanya Pavlova
Telerik team
answered on 23 Aug 2011, 10:12 AM
Hi Clinton,



You may submit a new support ticket and attach your runnable project there.


Kind regards,
Vanya Pavlova
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
clinton@clintoncherry.com
Top achievements
Rank 1
answered on 23 Aug 2011, 10:20 AM
Thanks again.

I looked further in detail at my app.xaml and have solved the problem - it was my own fault sorry.
The problem was that the style should have been a staticResource not a dynamic resource for the value below

<Style BasedOn="{DynamicResource ListBoxItemStyleMain}" TargetType="{x:Type ListBoxItem}"/>
0
Accepted
Vanya Pavlova
Telerik team
answered on 23 Aug 2011, 10:26 AM
Hello Clinton,

 
I am glad to hear that you were able to resolve the issue by your side. When you experience similar problems related to any RadControl it would be much more better to directly submit a new support ticket with a runnable project which we can test locally. Thus we would be able to provide you with an appropriate solution.



If you need any further assistance do not hesitate to contact us!

 

Greetings,
Vanya Pavlova
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
clinton@clintoncherry.com
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
clinton@clintoncherry.com
Top achievements
Rank 1
Share this question
or