ListViews SelectedIndexChanged Event Options

  • Thread starter Thread starter ArunDhaJ
  • Start date Start date
A

ArunDhaJ

Hi Friends,

I'm using .Net1.1.
The SelectedIndexChanged event is generated twice when i change the
selection. I think this is because the event is triggered when an
item
loses focus and the other item gains focus.
I want this event to be triggered only once.


Plz help me in solving this problem...


Thanks in advance....


Regards
ArunDhaJ
 
Hi Friends,

I'm using .Net1.1.
The SelectedIndexChanged event is generated twice when i change the
selection. I think this is because the event is triggered when an
item
loses focus and the other item gains focus.
I want this event to be triggered only once.


Plz help me in solving this problem...


Thanks in advance....


Regards
ArunDhaJ

A solution to secondary events is using a flag or similar that lets you detect if the event has been handled or not.
 
ArunDhaJ said:
The SelectedIndexChanged event is generated twice when i change the
selection. I think this is because the event is triggered when an
item
loses focus and the other item gains focus.
I want this event to be triggered only once.

By default the event is raised only once, when the new item gains focus, so
this is unlikely to be the cause. You can check if you have manually
attached a handler to the event. Removing it would be the best solution.

EventHandlers are attached using the syntax: "listView.SelectedIndexChanged
+= new EventHandler(...);".

Best Regards,
Stanimir Stoyanov
www.stoyanoff.info | www.aeroxp.org
 
Back
Top