Overwriting RadCheckBox Intermediate State styles with SetThemeValueOverride

3 posts, 1 answers
  1. Sandor
    Sandor avatar
    17 posts
    Member since:
    Jan 2018

    Posted 17 Jan Link to this post

    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. Answer
    Dimitar
    Admin
    Dimitar avatar
    2823 posts

    Posted 21 Jan Link to this post

    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.
  3. Sandor
    Sandor avatar
    17 posts
    Member since:
    Jan 2018

    Posted 25 Jan in reply to Dimitar Link to this post

    Thank you Dimitar, it works!

    Regards,
    Sandor

Back to Top