Multiple Grid but Different Coloring

2 posts, 0 answers
  1. Lee
    Lee avatar
    49 posts
    Member since:
    Feb 2010

    Posted 09 Jun 2010 Link to this post


    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.


  2. Stefan
    Stefan avatar
    2911 posts

    Posted 15 Jun 2010 Link to this post

    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,
    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.
Back to Top