> > I have a ListView control and based on the item selection, another
> > control is updated. That update process is relatively slow.
[quoted text clipped - 23 lines]
> else
> bypass the code execution.
HI darnold,
My problem is that the process "someone makes a selection" is an
atomic process when using the listview selectedindexchange event:
there is no easy way of determining whether more selectedindexchanged
events are going to be fired or not.
So, if that would be possible, i could skip the processing of all
selectedindexchanged events but one in the way you proposed.
Mr. Arnold - 18 Jun 2007 18:13 GMT
Every time you deal with that Listview, you are loading the Listview with
items, clearing it, or a user makes a selection, the selectedindexchange
event is going to firer.
You know when it's being loaded and you know when it's being cleared. So if
you know these things and the area of the code where you are doing these
things, you set the flag to bypass the code in the event and set the flag
to not bypass when these things are completed.
If the flag is setting at not bypass, it's because your code at the area of
loading and clearing the Listview has completed its task and set the flag.
Anytime after the tasks above of loading and clearing are completed with
the area of code setting the flag to not bypass, it will be someone making a
selection that caused the event to fire and the code will be executed.
When you're loading and clearing, set the flag to bypass. When you're done
with loading and clearing, set the flag to not bypass.