Listview with Checkboxes and no Multiselect

  • Thread starter Thread starter Rob Hewlett
  • Start date Start date
R

Rob Hewlett

I'm trying to use a ListView WITH checkboxes and simulate
the multiselect=false functionality in the compact
framework. Does anyone have any suggestions on how to
accomplish this? For the moment, I've subclassed
ListView and tried overriding OnClick() and setting the
checkboxes to false, but this does not work consistently
(in some circumstances, I end up with multiple items
checked).

Thanks in advance for any help!
 
This code works for me.

protected override void OnItemCheck(ItemCheckEventArgs e) {
for (int i = 0; i < this.Items.Count; i++) {
if (i == e.Index) continue;
Items.Checked = false;
}

Alex.
 
Back
Top