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

Using checkmark to change background color

2 Answers 224 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
bnooyen
Top achievements
Rank 1
bnooyen asked on 04 Jan 2007, 04:28 PM
Simple enough, I would like to change the background color of the radCheckmark in a Checkbox depending on its click state.

If it's on, color 1.
If it's off, color 2.

I've played with CheckState but just cannot seem to get it to work.  Could someone point me in the right direction that would showcase just how to do this, perhaps in the default checkbox theme?

2 Answers, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 04 Jan 2007, 06:25 PM
Hello Brett,

The tricky part is that RadCheckBox inherits most of its behavior and properties from the RadToggleButton control. Thus the property you should use to check if the checkbox is checked is called Telerik.WinControls.UI.RadToggleButtonElement.ToggleState

In order to create a theme based on this property you should do the following:
  1. Load the RadCheckBox control in the VSB (you can optionally load the default theme as well)
  2. Select the Fill primitive inside the Checkmark element. Hint - zooming the preview would get you there much easier. 
  3. Add a new state and click the "edit" icon button on the state tab-item to open the state editor dialog.
  4. In the "apply condition" section select the split button's "Show Condition editor" option - the Condition builder dialog should appear
  5. In the property box, select or type in the full prop name , i.e.:
    Telerik.WinControls.UI.RadToggleButtonElement.ToggleState and select "On" for the Value

Now the customizations you do to the properties of the fill-primitive would apply only when the "ToggleState = On" condition is met.

Attached is an example theme that you may use as a starter.


Greetings,
Mike
the telerik team
0
bnooyen
Top achievements
Rank 1
answered on 04 Jan 2007, 07:41 PM
Mike,

Thanks for your help and example, it's crystal clear now!

Brett
Tags
Themes and Visual Style Builder
Asked by
bnooyen
Top achievements
Rank 1
Answers by
Mike
Telerik team
bnooyen
Top achievements
Rank 1
Share this question
or