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

Multiple Grid but Different Coloring

1 Answer 83 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 1
Lee asked on 09 Jun 2010, 11:38 AM
Hi,

Might be this question is repeated but i still have a doubt.

I have 3 grids on a single WinForm.  I applied "Breeze" theme to all 3 grids. 
Now want i want to do is apply different color shade to all 3 grids on top of Breeze theme.
eg. 1st grid Blue  (which is default of Breeze theme)
      2nd grid light RED
      3rd Grid  light Green.

IF i use below code it changes color for all Grids.
HslColor baseColor = HslColor.FromArgb(255, 56, 154, 254);  
currentTheme.AddColorBlend("BaseColor", baseColor);  
currentTheme.ThemeProperties["BaseColor"] = HslColor.FromArgb(255, 204, 102, 0);  
 

Is there better way to apply different color shade to all 3 grids on top of Breeze theme  or any Alternative way to achieve the task.

Regards

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 15 Jun 2010, 10:09 AM
Hello Lee,

Thank you for writing to us.

The Color Blending feature applies its settings at a theme level. So, if your three RadGridView instances have the Breeze theme set, they all will get the changes set by one Color Blending shade. That said, in order to get three different shades, you need to have three different copies of the Breeze theme, each one with different ThemeName:
  • Open the Breeze theme with with the old Visual Style Builder.
  • Edit the theme and save it with a ThemeName in a new file.
  • Subscribe your form to the Load event: 
this.Load += new EventHandler(RadForm1_Load);
  • Change the blends for the themes:
void RadForm1_Load(object sender, EventArgs e)
       {
           radGridView1.ThemeName = "Breeze1";
           Theme currentTheme = Telerik.WinControls.ThemeResolutionService.GetTheme("Breeze1");
           currentTheme.AddColorBlend("BaseColor", HslColor.FromArgb(255, 56, 154, 254));
           currentTheme.ThemeProperties["BaseColor"] = HslColor.FromColor(Color.PaleGreen);
 
           radGridView2.ThemeName = "Breeze2";
           Theme currentTheme2 = Telerik.WinControls.ThemeResolutionService.GetTheme("Breeze2");
           currentTheme2.AddColorBlend("BaseColor", HslColor.FromArgb(255, 56, 154, 254));
           currentTheme2.ThemeProperties["BaseColor"] = HslColor.FromColor(Color.Violet);
       }

For additional information about the Color Blending feature please refer to our documentation.

I hope this will help you.

Best wishes,
Stefan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Themes and Visual Style Builder
Asked by
Lee
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or