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

Change the base color of the "Default" theme

5 Answers 577 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 09 May 2013, 11:13 PM
I've read posts about color blending and I think that is no longer available.  I would like to create some theme options for the user to pick from a color dialog (attached image) and apply that color as the color of the "Default" theme.  What is the way to do that now?

Thank you,
Gary

5 Answers, 1 is accepted

Sort by
0
Anton
Telerik team
answered on 14 May 2013, 12:55 PM
Hello Gary,

Thank you for writing.

Yes, you are right that color blending is no longer supported. Currently, you have two options:

1. To create several different themes with different predefined colors and user to be able to choose between them.
2. To change the theme at runtime. The following code snippet demonstrates how to iterate through all repositories and how to access some specific style group at run time.
//iterate through all repositories
Theme theme = ThemeRepository.FindTheme("ControlDefault");
if (theme != null)
{
    foreach (StyleRepository repository in theme.Repositories)
    {
        
         
    }
}
 
//access some specific style group
Theme controlDefaultTheme = ThemeRepository.FindTheme("ControlDefault");
StyleGroup group = controlDefaultTheme.FindStyleGroup("Telerik.WinControls.UI.RadGridView");
 
foreach (PropertySettingGroup settingGroup in group.PropertySettingGroups)
{
    if (settingGroup.Selector.Value == "GridHeaderCellElement")
    {
        foreach (PropertySetting property in settingGroup.PropertySettings)
        {
            if (property.Name == "BackColor2")
            {
                 
            }
        }
    }
}

I hope this information helps.

All the best,
Anton
the Telerik team
RadChart for WinForms is obsolete. Now what?
0
Doug
Top achievements
Rank 1
answered on 28 May 2013, 11:34 PM
I was thinking that I want to do option 1 and load "ControlDefault" into Visual Style Builder, change some colors, and save it as a new theme...several times to get a basic green, red, indigo, etc. themes.  I started down this path in the forum earlier and am just now returning to it.  Do I need to change colors on every control or is there some place to set colors that will affect all the controls?
0
Anton
Telerik team
answered on 31 May 2013, 03:43 PM
Hi Gary,

Thank you writing back.

There is no such property that you can change to change the color of each control from our suite. However, when we were creating our themes we were trying to set every property with repository. A repository is a predefined set of properties that can be applied to some primitive or element. These repositories are reused for more than one control. For example, we have fill repository that sets some blue color for background so, this repository is applied for every element in our controls that should display this color. So, the best way to change colors in the theme is to change the colors in the repositories. Each theme has hundreds of repositories, so this will be not fast and easy task, but is the most suitable way to achieve your goal.

I hope this information helps.

Regards,
Anton
Telerik
RadChart for WinForms is obsolete. Now what?
0
Fabrizio
Top achievements
Rank 1
answered on 20 May 2019, 06:28 AM

Hello

Can you tell me if is it possible to retrieve the color theme of the selected row in a radgridview ? The "propertySetting" name is the same for all Theme ?

Thank you

 

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 May 2019, 12:01 PM
Hello, Fabrizio,     

I would like to note that the different themes in the Telerik UI for WinForms suite have their own implementation. You can't reply on the fact that the names of the repository settings will be identical in all themes. Usually, manipulating a theme at run time is not a recommended approach as it would include a lot of code for even simple customizations. 

If you need to customize a theme, the easiest way to do it is by using Visual Style Builder. You can export the built-in themes, then load a certain theme as a starting point for the customizations, perform the style changes and save the custom theme.

You can read more details about using the Visual Style Builder here:

1.     Loading predefined themes
2.     Working with Repository Items
3.     Saving and Loading Theme Files
4.     Loading Themes from an External File
5.     Loading Themes from a Resource
6.     Applying Theme to a Control
7.     http://tv.telerik.com/watch/winforms/visualstylebuilder/whats-new-visual-style-builder-q1-2010


I hope this information helps. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Themes and Visual Style Builder
Asked by
Doug
Top achievements
Rank 1
Answers by
Anton
Telerik team
Doug
Top achievements
Rank 1
Fabrizio
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or