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

ASPxCheckBoxList - How to emulate ASPxRadioButtonList that allows users to unselect items

$
0
0

Unfortunately, ASPxRadioButtonList does not allow handling the click event for a separate item. Thus, it is better to use ASPxCheckBoxList to allow users to unselect items. Handle the SelectedIndexChanged event to emulate the ASPxRadioButtonList behavior in the following way:


[JScript]
function OnCBLSelectedIndexChanged(s, e){ s.UnselectAll();if(e.isSelected) s.SetSelectedIndex(e.index);else s.UnselectIndices(e.index);}

Then, customize the control's images using the SpriteProperties property and specifying the corresponding theme name in the prefix of a class:

[ASPx]
<dx:ASPxCheckBoxList...Theme="DevEx"> ...<CheckedImageSpriteProperties-CssClass="dxEditors_edtRadioButtonChecked_DevEx"></CheckedImage><UncheckedImageSpriteProperties-CssClass="dxEditors_edtRadioButtonUnchecked_DevEx"></UncheckedImage><Items> ...</Items></dx:ASPxCheckBoxList>

See Also:
CheckBoxList - How to emulate RadioButtonList that allows users to unselect items


Viewing all articles
Browse latest Browse all 7205

Trending Articles



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