ListView + CheckBoxes: do not check if select?

  • Thread starter Thread starter Boris Nienke
  • Start date Start date
B

Boris Nienke

hi,

i would like to use the checkboxes in a ListView. This works.
But:
- when i click an item then the checkbox is toggled too

is there a way to just toggle the checkbox by clicking the checkbox (and
NOT the item/subitems)?

i know, this is a FAQ but i havn't found a solution yet.
The only one was: "use the ItemCheck Event like this":

private void listView1_ItemCheck(object sender,
System.Windows.Forms.ItemCheckEventArgs e)
{
if (e.CurrentValue != e.NewValue)
{
e.NewValue = e.CurrentValue;
}
}

but then i cannot toggle the checkbox with the stylus at all - so it's
not really a solution :)

Any ideas?

Boris
 
Boris,

Take a look at the property "Full Row Select" on your listview control.

-Darren
 
What do you mean?
i've set it to TRUE (because i like to select the whole row when you
clik somewhere in it)

now, because of your posting, i've set it to false (just for testing)
but the behaviour is still the same. But now i have to click into the
first column to select an item (and just the first column is blued). The
checkbox is still toggeling when i klick the item...

more ideas?

boris
 
Back
Top