I have installed a CheckStateGetter and CheckStatePutter in order to control a boolean field on my binded objects reflecting a checkstate on the first column.
listViewShapeEvents.CheckStateGetter = delegate (Object row) {
var evItem = (ShapeEventItem)row;
if (evItem == null) return CheckState.Unchecked;
return evItem.active ? CheckState.Checked : CheckState.Unchecked;
};
listViewShapeEvents.CheckStatePutter = delegate (Object row, CheckState newValue) {
var evItem = (ShapeEventItem)row;
if (evItem == null) return CheckState.Indeterminate;
evItem.active = !evItem.active;
return evItem.active ? CheckState.Checked : CheckState.Unchecked;
};
I am not able to make it to work.
If the binded object already have the "active=true" flag, the box is checked but CANNOT be unchecked.
If the binded object do have "active=false", the box is unchecked AND user can check or uncheck (the CheckStatePutter is called).
There is something that prevent the CheckStatePutter to be called when the checkbox is set.
AspectName="active" on that column, if i do not specify AspectName, the whole checkbox system do not work, an indeterminate checkbox is displayed in all rows, despite the CheckStateGetter/Putter is specified.