This is a migrated thread and some comments may be shown as answers.
Overwriting RadCheckBox Intermediate State styles with SetThemeValueOverride
2 Answers 15 Views
This is a migrated thread and some comments may be shown as answers.
Sandor
Top achievements
Rank 1
Sandor asked on 17 Jan 2019, 10:26 AM

Hi!

I have a tri-state RadCheckBox and tried to change its intermediate state background color with the "SetThemeValueOverride", but nothing happens.

The code is the following:

checkBox.ButtonElement.CheckMarkPrimitive.CheckElement.GradientStyle = GradientStyles.Solid;

checkBox.ButtonElement.CheckMarkPrimitive.SetThemeValueOverride(FillPrimitive.BackColorProperty, Color.Black, "ToggleState=Intermediate", typeof(FillPrimitive));

 

What do I wrong?

 

Thank you,

Sandor

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 21 Jan 2019, 12:24 PM
Hello Sandor,

You can use the following code to override the theme values:
radCheckBox1.ButtonElement.SetThemeValueOverride(CheckPrimitive.BackColorProperty, Color.Black, "ToggleState=Intermediate", "RadCheckBoxCheckPrimitive");
radCheckBox1.ButtonElement.SetThemeValueOverride(CheckPrimitive.BackColor2Property, Color.Black, "ToggleState=Intermediate", "RadCheckBoxCheckPrimitive");
radCheckBox1.ButtonElement.SetThemeValueOverride(CheckPrimitive.ForeColorProperty, Color.Black, "ToggleState=Intermediate", "RadCheckBoxCheckPrimitive");

The last parameter is the class of element and can be seen in Visual Style Builder (see attached).

Should you have any other questions do not hesitate to ask. 

Regards,
Dimitar
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.
0
Sandor
Top achievements
Rank 1
answered on 25 Jan 2019, 12:21 PM

Thank you Dimitar, it works!

Regards,
Sandor

Asked by
Sandor
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Sandor
Top achievements
Rank 1
Share this question
or