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

Problem with theme

1 Answer 155 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Tooraj
Top achievements
Rank 1
Tooraj asked on 30 Apr 2011, 07:21 AM
Hi,
When I change entire app's theme using associated class, My grid's header font doesn't appear with the font I set for prevous theme. this happens for Win7 and Desert themes. How to solve this? please tell me.
How can I get rid of Telerik theme's header display glitch (shows header gray color and after mouse hover backs to original color(green))?
Thank you again, Tooraj Azizi.

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 04 May 2011, 05:25 PM
Hi Tooraj,

Thank you for writing.

The Telerik theme is a theme created with our old theming mechanism and we are no longer providing fixes for it. We are planing on remaking it using our new theming mechanism, but at the moment I cannot give you a specific time frame for this. 

For the moment you can use the ViewCellFormatting event of the RadGridView to resolve both your issues. Consider the following code snippet:

void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.CellElement is GridHeaderCellElement)
    {
        e.CellElement.Font = new Font(FontFamily.GenericMonospace, 12);
  
        if (ThemeResolutionService.ApplicationThemeName == "Telerik")
        {
            e.CellElement.BackColor = Color.FromArgb(246, 254, 213);
            e.CellElement.BackColor2 = Color.FromArgb(232, 253, 154);
            e.CellElement.BackColor3 = Color.FromArgb(218, 251, 94);
            e.CellElement.BackColor4 = Color.FromArgb(218, 251, 94);
            e.CellElement.GradientPercentage = 0.49f;
            e.CellElement.GradientPercentage2 = 0.50f;
            e.CellElement.NumberOfColors = 4;
            e.CellElement.DrawFill = true;
        }
        else
        {
            e.CellElement.ResetValue(GridHeaderCellElement.BackColorProperty);
            e.CellElement.ResetValue(GridHeaderCellElement.GradientStyleProperty);
            e.CellElement.ResetValue(GridHeaderCellElement.DrawFillProperty);
        }
    }
}

I hope this will help. If you have further questions, I would be glad to help.

All the best,
Ivan Petrov
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Tags
Themes and Visual Style Builder
Asked by
Tooraj
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or