Listview with Checkboxes and no Multiselect

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!
 
A

Alex Furman

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top