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

[Solved] Grid Named Brushes no longer working in latest version

5 Answers 127 Views
Grid for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Simon
Top achievements
Rank 1
Simon asked on 06 Mar 2014, 07:10 PM
After installing the latest version (Telerik UI for Windows 8.1 XAML, version=2014.1.221) I have noticed that the Grid Named Brushes no longer work.  The grid styling has gone back to the default (black/grey).  I have the named brushes below in a global style xaml, but they are no longer taking affect after the upgrade.  Other controls like the NumericBox and DatePikcer seem to be fine and their named brushes are working.  I tried reverting back to an older version and the styling starts to work again. Is this a new bug or has something changed?  Note I upgraded from 2 versions prior, so not sure when this behavior started appearing.

    <SolidColorBrush x:Key="TelerikGridBackgroundBrush" Color="White" />
    <SolidColorBrush x:Key="TelerikGridForegroundBrush" Color="Black" />
    <SolidColorBrush x:Key="TelerikGridBorderBrush" Color="LightGray" />
    <SolidColorBrush x:Key="TelerikGridHeaderBackgroundBrush" Color="LightGray" />
    <SolidColorBrush x:Key="TelerikGridHeaderForegroundBrush" Color="Black" />
    <SolidColorBrush x:Key="TelerikGridAlternateRowBackgroundBrush" Color="#E6E6E6" />

    <SolidColorBrush x:Key="TelerikGridShadowBrush" Color="LightGray" />
    <SolidColorBrush x:Key="TelerikGridInnerShadowBrush" Color="LightGray" />

    <SolidColorBrush x:Key="TelerikGridCurrentCellBackgroundBrush" Color="LightGray" />

    <SolidColorBrush x:Key="TelerikGridSelectedBackgroundBrush" Color="LightGray" />
    <SolidColorBrush x:Key="TelerikGridSelectedBorderBrush" Color="#00366B" />
    <SolidColorBrush x:Key="TelerikGridPointerOverBackgroundBrush" Color="LightGray" />

Thanks
Simon
















5 Answers, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 07 Mar 2014, 10:41 AM
Hello Simon,

Thank you for contacting us.

We have tested the grid brushes and they are applied properly on our side. I have attached a sample project for demonstration. Could you please take a look and see if this works fine on your side. Since you say that the other brushes work well, I think it is possible that you have missed something in your code. Also, here are two articles from our online documentation with information how to use and override the Telerik brushes:
If you cannot make the brushes work, could you please send us a project that reproduces the problem and we will investigate it.

I hope this helps. Let us know if you have further questions.

Regards,
Rositsa Topchiyska
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

0
Simon
Top achievements
Rank 1
answered on 07 Mar 2014, 03:30 PM
I think I may have figured out the issue, but something must have changed between telerik versions causing it to break for us, as it was definitely working prior. It seems to be the difference in the way we are setting up the dictionaries in the app.xaml.  We have been using merged dictionaries and separate xaml files for styles, like this;
​ <Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Common/StandardStyles.xaml" />
<ResourceDictionary Source="Common/FieldMobileStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

This has always worked fine for us in previous versions.  (again note, we were on RadControls for Windows 8, Version=2013.3.1105).  But has broken in our upgrade to Telerik UI for Windows 8.1 XAML, Version=2014.1.221.

Your sample project has the styles setup like this;
​ <Application.Resources>
<ResourceDictionary>
<telerik:UserThemeResources x:Key="ThemeResource" DarkResourcesPath="ms-appx:///Dark.xaml"/>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="{CustomResource DarkResourcesPath}"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Application.Resources>

Is it something to do with this?  <telerik:UserThemeResources

I have reattached your sample solution with the files and changes on how we have been doing this, so you can see it does not work.

The other thing I noticed is that you can not override named brushes right on the page, I believe this previously worked as well, but don't remember for sure.

Let me know if you have any ideas on how I might be able to fix this given our current structure. Otherwise I can alter our code to load the dictionary similar to how you are doing it in your sample.  It also seems strange that this issue applies only to the Grid, all other telerik controls where we override named brushes still work the same as always with the same code structure.  There was likely some small change done to the grid which altered the way the named brushes are loaded/used.

Thanks again for your help on this.
Simon

Actually it will not let me attach the zipped solution, so I will try and email it to you.
0
Simon
Top achievements
Rank 1
answered on 07 Mar 2014, 03:32 PM
How can I email you the changed sample solution files?

Thanks
Simon
0
Rosy Topchiyska
Telerik team
answered on 07 Mar 2014, 05:29 PM
Hello Simon,

Yes, the Telerik named brushes are resolved differently in Windows 8 and 8.1 version of the controls. Please, could you take a look at these articles from our online documentation where it is explained how to use the brushes in Windows 8.1:

I hope this helps. Please, let us know if you still have any problems.

Regards,
Rositsa Topchiyska
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

0
Simon
Top achievements
Rank 1
answered on 31 Mar 2014, 02:44 PM
Thanks Rositsa, got it all working.

Simon

Tags
Grid for XAML
Asked by
Simon
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Simon
Top achievements
Rank 1
Share this question
or