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

Order of checkbox states

4 Answers 9 Views
CheckBox
This is a migrated thread and some comments may be shown as answers.
Piotr
Top achievements
Rank 1
Piotr asked on 02 Dec 2019, 03:12 PM

Is it possible to change order of checkbox states?

Now states are ordered indeterminate, unchecked, checked.

But when I initialize form with null for checkbox variables, so checkboxes are in indeterminate state.

First state after click such checkbox would be checked.

4 Answers, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 03 Dec 2019, 09:22 AM

Hello Piotr,

I am afraid this scenario could not be achieved. The flow of the RadCheckBox state is as follow Indeterminate, Unchecked, Checked.  If you do not need indeterminate state you could disable it when set IsThreeState = "False". In this way the you won't be able to enter Indeterminate state through the UI, so the fist state of the checkbox will be Unchecked and the next state - Checked. 

I hope this will help.

Regards,

Didi
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Piotr
Top achievements
Rank 1
answered on 03 Dec 2019, 11:46 AM

In my scenario I use ThreeStates for checkbox.
The main problem is that, when user load form, all of checkboxes are in indeterminate state, as not set.
Then user set fields, ON or OFF, but in most scenarios users set ON (Checked), so user must tap two times in checkbox in order to set Checked state. I must maintain indeterminate state for required field validation.

If it will be possibility to change order of states, to [Indeterminate, Checked, Unchecked] users could save their time during fillup form.

0
Accepted
Didi
Telerik team
answered on 04 Dec 2019, 01:14 PM

Hello Piotr,

I understand the requirements you have. I have further reviewed the code and by default the CheckBox IsChecked state flow is indeterminate, unchecked, checked. I have found a way how this can be changed inside the IsCheckedChanged method. Mainly you need a flag that will track when the state is changed and change the value of the property bind to the CheckBox IsChecked property. 

I have attached a sample how this could be achieved. Download it and give it a try.

I hope I was helpful.

Regards,
Didi
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Piotr
Top achievements
Rank 1
answered on 05 Dec 2019, 11:54 AM
Thanks for solution, I tested and it is ok.
Tags
CheckBox
Asked by
Piotr
Top achievements
Rank 1
Answers by
Didi
Telerik team
Piotr
Top achievements
Rank 1
Share this question
or