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

CellStyleSelector not working when I use the Telerik Themes

5 Answers 154 Views
GridView
This is a migrated thread and some comments may be shown as answers.
R
Top achievements
Rank 1
R asked on 06 Aug 2014, 11:00 AM
Hi, I want to use your Office_Black theme as a base theme for my GridViews but I also need conditional cell styles to be applied. To do this I am using your CellStyleSelector. When the code executes the CellStyleSelector code is called but the styles are not being applied. I assume the Telerik theme is overriding my local styles? Is this the case and how can I fix this please? 

Thanks a lot.

From my User Control:

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Styles/OrderStyles.xaml " />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

From the grid xaml:

            <telerik:RadGridView.Columns >
                <telerik:GridViewDataColumn DataMemberBinding="{Binding OrderStatus}" Header="Status" CellStyleSelector="{StaticResource OrderStatusStyleSelector}"/>

From my app.xaml:

<Application x:Class="My.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Application.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/System.Windows.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Docking.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.GridView.xaml"/>
            </ResourceDictionary.MergedDictionaries>

5 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 06 Aug 2014, 12:05 PM
Hi Russel,


Thank you for getting back to us.

Looking at the snippet provided I suggest that you isolated style selector styles in a custom resource dictionary OrderStyles.xaml. 

In our online documentation, we have an article, which explains how to switch these custom styles, here.

Will you please give it a try and let me know how it goes?


Regards,
Vanya Pavlova
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
R
Top achievements
Rank 1
answered on 06 Aug 2014, 01:05 PM
Thanks for the quick response Vanya. As I show above I already have the styles isolated in a separate resource dictionary. 

I can't see how the custom styles link you provided applies to my problem.

Can you try reproduce this as I described in my first post? So a GridView styled using the NoXaml Office_Black Theme then try to style a cell using the CellStyleSelector.

Thanks
0
R
Top achievements
Rank 1
answered on 06 Aug 2014, 01:22 PM
Update: Interestingly when i change to use the standard binaries instead of using the NoXaml binaries the CellStyleSelector works.

Please try reproduce this - ideally I'd want to use the NoXaml version.
0
Vanya Pavlova
Telerik team
answered on 10 Aug 2014, 09:22 PM
Hello Russel,


Thank you for getting back to us.

I will prepare sample demo, that will illustrate how to integrate your style selector with custom cell styles and NoXAML binaries, later today. 



Regards,
Vanya Pavlova
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Accepted
Vanya Pavlova
Telerik team
answered on 11 Aug 2014, 12:45 PM
Hello Russel,


I'm attaching you sample demo, which illustrates how to define your own style selector using NoXAML binaries for Office_Black. 


Regards,
Vanya Pavlova
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
R
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
R
Top achievements
Rank 1
Share this question
or