PC Review


Reply
Thread Tools Rate Thread

ComboBox - SelectedIndexChanged Event Bug

 
 
Neelima Godugu
Guest
Posts: n/a
 
      28th Sep 2003
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


 
Reply With Quote
 
 
 
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      28th Sep 2003
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

"Neelima Godugu" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Neelima Godugu
Guest
Posts: n/a
 
      29th Sep 2003
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
"Alex Feinman [MVP]<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
> "Neelima Godugu" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
khorad
Guest
Posts: n/a
 
      29th Sep 2003
"Alex Feinman [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
David So [MSFT]
Guest
Posts: n/a
 
      8th Oct 2003
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" <(E-Mail Removed)>
| References: <(E-Mail Removed)>
<(E-Mail Removed)>
| 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: <(E-Mail Removed)>
| 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
|
| "Alex Feinman [MVP]" <(E-Mail Removed)> wrote in message
| news:(E-Mail Removed)...
| > 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
|
|
|

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
combobox SelectedIndexChanged event biffo71 Microsoft C# .NET 1 11th Jan 2007 09:57 AM
combobox SelectedIndexChanged event biffo71 Microsoft C# .NET 2 11th Jan 2007 08:03 AM
combobox selectedindexchanged event tbrown Microsoft C# .NET 6 31st Dec 2006 02:14 PM
Suspend ComboBox SelectedIndexChanged event Joe Microsoft C# .NET 2 19th Feb 2005 12:28 AM
RE: Combobox SelectedIndex and SelectedIndexChanged event Bug =?Utf-8?B?RGV4dG9y?= Microsoft C# .NET 0 2nd Feb 2004 09:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:49 AM.