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

Themes with GridView

4 Answers 179 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ivan
Top achievements
Rank 1
Ivan asked on 21 Mar 2014, 10:20 AM
I'm trying to create a control with the same colors of RadGridView.
I tried to use the GridView_HeaderBackground as background, and GridView_GridLinesItemBorder as borderbrush. But when i changed my theme to Windows8, the Resource will not be found. Is there global definition for all themes? I really need that, in order to change my control with different themes automatically.
My code is like that:
<Border Background="{DynamicResource GridView_HeaderBackground}"
   BorderThickness="1"
   BorderBrush="{DynamicResource GridView_GridLinesItemBorder}">

Thanks a lot.

4 Answers, 1 is accepted

Sort by
0
Ivan
Top achievements
Rank 1
answered on 25 Mar 2014, 08:14 AM
Nobody knows?
0
Yoan
Telerik team
answered on 26 Mar 2014, 08:57 AM
Hi,

Generally, I can suggest you to work with our Implicit Styles. Please check this help article, where you can find more information about them. The styles used in our themes are theme specific. You can find the styles/templates for GridView inside "Telerik.Windows.Controls.GridView.xaml" file browsing to "InstallationFolder\WPF\Themes\OfficeBlack(or Windows7/ Windows8 )\Themes" folder.

I hope this information helps.

Regards,
Yoan
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
Ivan
Top achievements
Rank 1
answered on 27 Mar 2014, 10:28 AM
Hi Yoan,

i have tried to use the style or color definitions in Telerik Theme before i asked the question.
Just in the file "Telerik.Windows.Controls.GridView.xaml" of theme Windows7 i found the definition of "GridViewHeaderCellStyle" with the Background definition.
<Setter Property="Background" Value="{StaticResource GridView_HeaderBackground}"/>
So i defined my control with same resource, but this definition has been changed in other themes, eg. Windows 8 with the definition:
<Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=LowBrush}"/>
That is the point, what i didn't understand. Why you guys define the same control with different resources.
How can i do that uniformly, if i want to define my control with the same resource, which was used for eg. GridViewHeaderCellStyle?

Thank a lot.
0
Accepted
Yoan
Telerik team
answered on 01 Apr 2014, 10:46 AM
Hi Ivan,

Indeed, Windows8 / Windows8Touch theme is very different than Windows7. Developing the Windows8 theme we had the need of as little as 6 brushes for our controls. Windows8 theme use this set of predefined colors, which are bound within the templates of our controls. These resources are global for all controls and once you change a single brush it will be automatically to all components in your application. You can check the Windows8 and Windows8Touch colors and fonts help article for a reference. If you need to modify a particular brush per control, you may create your own custom palette similar to the one for Windows8 and add an additional brush, which you can refer within the template of RadGridView or any other component. 

Regards,
Yoan
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
GridView
Asked by
Ivan
Top achievements
Rank 1
Answers by
Ivan
Top achievements
Rank 1
Yoan
Telerik team
Share this question
or