How to change checkbox checkPrimitive back color?

1 Answer 207 Views
Checkbox
James
Top achievements
Rank 1
James asked on 28 Jul 2023, 06:43 PM

How do you change the backcolor of the box where the checkmark is made?  This is not the control backcolor, but the color inside the checkbox.

In this link it is called RadCheckMark checkPrimitive (1.1) https://docs.telerik.com/devtools/winforms/controls/buttons/checkbox/structure

I can't find any property that controls that checkPrimitive back color.

 

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 02 Aug 2023, 01:23 PM

Hello James,

In Telerik UI the 'tick' glyph of the CheckBox is set as an svg background via CSS in the Html input created on the client-side. 

To change its color you need copy the configuration and change the stroke property to the desired color:

    .k-checkbox:checked, .k-checkbox.k-checked{
        background-color:red;
        border-color:red;
        background-image:  url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='blue' stroke-linecap='square' stroke-linejoin='square' stroke-width='2' d='M3,8 l3,3 l7-7'/%3e%3c/svg%3e");
    }

For your convenience I have applied the above to this Telerik REPL

Please give the approach a try and don't hesitate to let me know whether any issues on the topic arise.

Regards,
Stoyan
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Tags
Checkbox
Asked by
James
Top achievements
Rank 1
Answers by
Stoyan
Telerik team
Share this question
or