ComboBox - SelectedIndexChanged Event Bug

N

Neelima Godugu

Hi,
I have noticed that SelectedIndexChanged event is fired twice if the
ComboBox is filled up by specifying datasource. Otherwise if you fill it up
using Items.Add this does not happen. Is this a known bug? Is there a work
around? I am using VS.NET 2003(RTM).
Thanks
Neelima
 
A

Alex Feinman [MVP]

Regardless of the control behavior, it is a good idea to disable event
handlers when the control is being populated. I typically use a boolean
flag, which I set before changing the control's datasource and clear
afterwards. I check this flag then inside event handlers.

PS I clearly remember someone complaining of this issue and someone else
claiming that it was fixed in one of the SPs. But after checking the
fixlists for both service packs I can't find the reference to this problem.
In any case make sure you are using SP1 and not RTM
 
N

Neelima Godugu

Alex,
Thanks for your response and suggestions but this does not help because the
selectedindexchanged event is not fired when data is being loaded to the
comboBox but it is fired when you click on the combobox for the firsttime.
For now I am not loading the combobox by setting the datasource property, i
am using items.add().
I tested out your solution and it did not work.
Thanks
Neelima
 
K

khorad

Alex Feinman said:
PS I clearly remember someone complaining of this issue and someone else
claiming that it was fixed in one of the SPs. But after checking the
fixlists for both service packs I can't find the reference to this
problem.

when i complained about the lack of a listbox click event, an MS guy said
that they were looking at adding it for SP2

no dice

i know this isn't the most helpful comment, but: SelectedIndexChanged
SUCKS!

setting flags is a necessary condition but that doesn't solve all your
problems

it's erratic/buggy behavior has caused me a disproportionate amount of grief
and lost time for being such a simple function
 
D

David So [MSFT]

Neelima,
I'm sorry for your problem you have experienced. The bug is not fixed in
either SP1 or SP2 but it will be fixed in next version of compact
framework.

David
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "khorad" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: ComboBox - SelectedIndexChanged Event Bug
| Date: Mon, 29 Sep 2003 10:53:31 -0400
| Lines: 22
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: rdu74-136-143.nc.rr.com 24.74.136.143
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:34691
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| | > PS I clearly remember someone complaining of this issue and someone else
| > claiming that it was fixed in one of the SPs. But after checking the
| > fixlists for both service packs I can't find the reference to this
| problem.
|
| when i complained about the lack of a listbox click event, an MS guy said
| that they were looking at adding it for SP2
|
| no dice
|
| i know this isn't the most helpful comment, but: SelectedIndexChanged
| SUCKS!
|
| setting flags is a necessary condition but that doesn't solve all your
| problems
|
| it's erratic/buggy behavior has caused me a disproportionate amount of
grief
| and lost time for being such a simple function
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top