Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion ComboBox.DataSource fires SelectedValueChanged event
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matt Gertz  
View profile  
 More options May 22 2003, 5:45 am
Newsgroups: microsoft.public.dotnet.languages.vb
From: mat...@online.microsoft.com (Matt Gertz)
Date: Wed, 21 May 2003 19:44:15 GMT
Local: Thurs, May 22 2003 5:44 am
Subject: Re: ComboBox.DataSource fires SelectedValueChanged event
Hi, Shawn,
  OK, I see what you're seeing now.  I was using "Add" to add values to the
combo box, not "DataSource."  Using "Add" doesn't cause the event to fire,
because using "Add" doesn't change the value of what's in the combo box's
edit box -- it leaves the edit box part alone.  (In fact, the edit box ends
up being blank if nothing was already in it.)  However, using "Datasource"
*does* change the value of the edit box -- incoming entries affect the
selected value, until the last one, where it resets to the first item for
the selection.  I do not see any way to turn this behavior off, short of
turning off the event handling or ignoring the event.  Of course, you could
iterate over the data itself and use "Add" to add values to the combobox,
but it's probably cheaper to ignore the event during initialization, unless
performance gets to be an issue due to all of those events.

Sorry I couldn't be of more help.  :-(  If you like, I could file a bug
against the appropriate team to investigate a possible change for future
versions, since I agree that this is less than desirable behavior.  (A
change is probably not likely, though, since there are folks who probably
have code that relies on the current behavior -- they might want to
"massage" entries after they get added to the list, etc.)

--Matt Gertz--*
VB
--------------------

> From: "Shawn" <bossman...@hotmail.com>
> References: <u9R2wptHDHA....@TK2MSFTNGP11.phx.gbl>

<yQbyzfwHDHA.2...@cpmsftngxa06.phx.gbl>
> Subject: Re: ComboBox.DataSource fires SelectedValueChanged event
> Date: Wed, 21 May 2003 11:29:59 +0200
> Lines: 119
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
> Message-ID: <elHIOu3HDHA.1...@tk2msftngp13.phx.gbl>
> Newsgroups: microsoft.public.dotnet.languages.vb
> NNTP-Posting-Host: pc4.akermaritime.no 193.161.152.244
> Path:

cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP 0
8.phx.gbl!tk2msftngp13.phx.gbl
> Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:109126
> X-Tomcat-NG: microsoft.public.dotnet.languages.vb

> Hi Matt. Thanks for helping me here.  I could do as you suggest and ignore
> the event until I initialize a variable, but I'm hoping there is another
> solution to the problem.  I'm attaching the vb file for you to have a look
> at.

> Shawn

> "Matt Gertz" <mat...@online.microsoft.com> wrote in message
> news:yQbyzfwHDHA.2172@cpmsftngxa06.phx.gbl...
> > Shawn,
> >   I've been trying to repro your experience (on VS 2003) but
unfortunately
> > without luck.  I've had similar issues in occasionally involving other
> > events, which I worked around by simply ignoring the offending events
> > during the form load -- there are a couple of ways to do this, but the
> > simplest is to just check the status of some initialization variable you
> > define.

> > I'd be happy to look into this further, but I'd need to see your
form_load
> > and InitializeComponent methods to determine anything more.

> > --Matt Gertz--*
> > VB
> > --------------------
> > > From: "Shawn" <bossman...@hotmail.com>
> > > Subject: ComboBox.DataSource fires SelectedValueChanged event
> > > Date: Tue, 20 May 2003 16:16:40 +0200
> > > Lines: 9
> > > X-Priority: 3
> > > X-MSMail-Priority: Normal
> > > X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> > > X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
> > > Message-ID: <u9R2wptHDHA....@TK2MSFTNGP11.phx.gbl>
> > > Newsgroups: microsoft.public.dotnet.languages.vb
> > > NNTP-Posting-Host: pc4.akermaritime.no 193.161.152.244
> > > Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
> > > Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:108894
> > > X-Tomcat-NG: microsoft.public.dotnet.languages.vb

> > > I'm populating the ComboBox in my Form_Load method and the
> > > SelectedValueChanged event fires according to how many items are
added.
> I
> > > want the event to fire when the user changes the value of the
ComboBox,
> > not
> > > when it's being populated.  What should I do?

> > > Thanks,
> > > Shawn


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google