J
J.L.
Hi,
I have a ListView on my form whose selection is used to populate
several text fields. When selecting a ListView item, the data for the
previous selection is checked for errors. If errors are found, a
message box is displayed and the user is returned to the previously
selected index.
I am using the ListView as a single selection control so in the event
handler, I am only checking for errors when the selected items count is
equal to 1. I expect to have this event fired twice (once for the
user's selection and once when I manually select the previous item) but
I am seeing it fired four times.
For example, assume my ListView looks as follows:
Item A
Item B
Item C
Assume that Item B was selected and changes were made that contain
errors. When you select Item C, the errors are detected, but the
message box detecting the errors is displayed twice. If I have a
message box that displays the selected item when the event is handled,
I will see the message boxes in the following order:
Item C selected
Errors were detected
Item B selected
Item C selected
Errors were detected
Item B selected
In the end, I am returned to the previous selection and the behavior
that I need but I get the error message twice.
Does anyone know why that event is firing twice?
Thanks!!
I have a ListView on my form whose selection is used to populate
several text fields. When selecting a ListView item, the data for the
previous selection is checked for errors. If errors are found, a
message box is displayed and the user is returned to the previously
selected index.
I am using the ListView as a single selection control so in the event
handler, I am only checking for errors when the selected items count is
equal to 1. I expect to have this event fired twice (once for the
user's selection and once when I manually select the previous item) but
I am seeing it fired four times.
For example, assume my ListView looks as follows:
Item A
Item B
Item C
Assume that Item B was selected and changes were made that contain
errors. When you select Item C, the errors are detected, but the
message box detecting the errors is displayed twice. If I have a
message box that displays the selected item when the event is handled,
I will see the message boxes in the following order:
Item C selected
Errors were detected
Item B selected
Item C selected
Errors were detected
Item B selected
In the end, I am returned to the previous selection and the behavior
that I need but I get the error message twice.
Does anyone know why that event is firing twice?
Thanks!!