Checkboxes
RadListViews' items have built-in checkboxes which can be shown by setting the ShowCheckBoxes property of RadListView to true.
Enable Checkboxes
When checkboxes are enabled, you have several options to handle the checked items:
- You can check or uncheck items via the checkbox that is shown in each item
Figure 1: Toggle the item by using the mouse
- You can get or set the checked state of the ListViewDataItem directly via its CheckedState property:
Toggle an item programmatically
Figure 2: Toggle items programmatically
You can get the checked items in RadListView via its CheckedItems collection
-
The CheckOnClickMode property gets or sets a value indicating whether the item's check state changes whenever the item is clicked. The following values are available:
- CheckOnClickMode.Off: Item's CheckState property is not toggled on click.
- CheckOnClickMode.FirstClick: Item is selected and the CheckState property is toggled on first click.
- CheckOnClickMode.SecondClick: Item is selected on first click. On second click the CheckState property is toggled.
-
You can listen for changes in the check state of the items via the following events:
- ItemCheckedChanging: Occurs when a ListViewDataItem is about to be checked. You can cancel this event.
- ItemCheckedChanged: Occurs when a ListViewDataItem is checked.