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

Cancel Item Check

1 Answer 90 Views
CheckedListBox
This is a migrated thread and some comments may be shown as answers.
Kem
Top achievements
Rank 1
Kem asked on 15 Dec 2011, 08:00 PM
Hello

I am setting a flag that is evaluated in ItemCheckedChanging. At times I need to stop an item from being checked. I have tried e.Cancel but it does not seem to work. In addition I looked for a property that contained previous checked state property but did not find anything.

I would like to be able to keep an item from being checked on a per item base.

Any suggestions?

Thank You

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 20 Dec 2011, 04:44 PM
Hi Kem,

Thank you for writing.

I have tested the described scenario and on my end I can successfully prevent an item from being checked by setting the Cancel property of the arguments in the ItemCheckedChanging event to true. Additionally, from the event arguments you can access the Item and from there its CheckedState, where you can see its state before it gets changed. Alternatively in the ItemCheckedChanged you can get the changed value from the same property.

Please have a look at my project and see how it works. Let me know if I can be of further assistance.
 
Regards,
Stefan
the Telerik team

Q3’11
of RadControls for WinForms is available for download (see what's new). Get it today.
Tags
CheckedListBox
Asked by
Kem
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or