Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to force the CheckedListBoxControl to change the item's state only when user clicks in the Glyph area.

$
0
0

To accomplish this task, you need to implement the boolean property (allowChangeCheck) in the CheckedListBoxControl descendant, which defines whether changing the check state is allowed. You need to create your own ListBoxControlState descendant for the appropriate state based on the SelectionMode that you want to assign for the CheckedListBoxControl, and override its MouseUp method to change the value of the allowChangeCheck property.

SelectionMode.One - SingleSelectState,
SelectionMode.MultiSimple - MultiSimpleSelectState,
SelectionMode.MultiExtended - ExtendedMultiSelectState,
SelectionMode.None - UnselectableState

Then, override the OnchangeCheck method of the Checked ListBoxControl class and suppress further processing, if the allowCHangeCheck property is false.

Question Comments

Added By: Scott Wylie at: 7/16/2015 11:44:52 AM    

This code prevents the user from using the spacebar to toggle the checkbox.  How should this be changed to include this functionality and ONLY click the glyph to check using the mouse?


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>