ListView.ItemCheck and ListView.ItemChecked in .NET.

What is the difference between a ListView. ItemCheck and ListView. ItemChecked events in .NET?

+8
events listview
May 26 '09 at 9:14 p.m.
source share
1 answer

The ItemCheck event is ItemCheck when the checked state of an item is about to change, allowing you to examine the old and new value and discard the change if you want (by setting the NewValue property of the eventargs parameter). ItemChecked launched after verification (or withdrawal) is completed.

Code example:

 private void ListView_ItemCheck(object sender, ItemCheckEventArgs e) { // the checked state of an item is about to change if (e.NewValue == CheckState.Checked) { // perform some check if this is allowed, and if not... e.NewValue = e.CurrentValue; } } private void ListView_ItemChecked(object sender, ItemCheckedEventArgs e) { // the checked state of an item has changed } 
+21
May 26 '09 at
source share



All Articles