Environment
- Windows XP x32 Visual Studio 2005 Standard Edition
- Honeywell Dolphin 9500 running Windows Mobile 2003 (Pocket PC 2003) With built in Barcode scanner and B&W camera Using their SDK located here.
- .NET Compact Framework 1.0 SP3 and .NET Framework 1.1
- Using VC#
Goal
I have a ListView control with CheckBoxes = true
and View = Details
on a form but I don't want the check boxes to be "checkable" by the user. I am using it for a status display of record completion. I do, however, want to use the event handler function to check the box via code (i.e. on record completion: lvMeters_ItemCheck(null, null);
).
Problem
I have disabled checking the box itself (I think, the touch screen isn't real precise on this device). However, when selecting a row (I have FullRowSelect = true
), the control often checks the checkbox and the event handler doesn't seem to be getting called.
Things I have Tried
I tried to basically undo the action in the event handler:
private void lvMeters_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (sender is ListView)
{
if (e.CurrentValue == CheckState.Checked)
lvMeters.Items[e.Index].Checked = true;
else
lvMeters.Items[e.Index].Checked = false;
}
else if (e.CurrentValue == CheckState.Checked)
lvMeters.Items[e.Index].Checked = false;
else
lvMeters.Items[e.Index].Checked = true;
}
The problem is the above handler doesn't get called on a listview select, nor does the SelectedItemChanged event handler call this event handler but it's still checking the box on select. It does get called when checking the box itself.
Need additional information?
Ask away and I'll do my best!
I'm A Novice
So please feel free to tell me I am doing this completely wrong and should do the entire thing differently.