By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,068 Members | 1,176 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,068 IT Pros & Developers. It's quick & easy.

ComboBox: Value after change event.

P: n/a
I have a DataBound ComboBox, which has a text value as the Value property,
and the UniqueID for that value is bound to the Combobox.Tag property.

When a user makes a new selection in the combobox, I need to run a SQL Query
with the UniqueID of the new value they are picking.

The .SelectedIndexChanged and .SelectedValueChanged events give me the .Tag
value BEFORE the new selection is made. I'm getting the value for the
previous value, rather than the new value the user has selected.

What order to the various change events occur, and which one will give me
the new values, as opposed to the old values?
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Kelvin,

How did you do that? your combo box behaviour is exactly what I wanted!

Anson
"Kevin Hodgson" <ke***@caseware.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
I have a DataBound ComboBox, which has a text value as the Value property,
and the UniqueID for that value is bound to the Combobox.Tag property.

When a user makes a new selection in the combobox, I need to run a SQL Query with the UniqueID of the new value they are picking.

The .SelectedIndexChanged and .SelectedValueChanged events give me the ..Tag value BEFORE the new selection is made. I'm getting the value for the
previous value, rather than the new value the user has selected.

What order to the various change events occur, and which one will give me
the new values, as opposed to the old values?

Nov 21 '05 #2

P: n/a
I didn't do anything special...
Private Sub cmbSelector_SelectedValueChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles cmbSelector.SelectedValueChanged

Me.DsDataSet1.Clear()
Try
Me.daDataAdapter1.SelectCommand.Parameters.Item("@ SelectorID").Value =
Me.cmbSelector.Tag
Me.daDataAdapter1.Fill(Me.DeDataSet1)
Catch ex As Exception
MsgBox(ex.Message)
Application.Exit()
End Try
End Sub

Me.cmbSelector.Text correctly shows the new value, .Tag shows the 'Index' of
the previous value.
"Anson" <p_o_o_n_a-n-s-o-n@t_NO_SPAM_orontosquare.com> wrote in message
news:ub**************@TK2MSFTNGP14.phx.gbl...
Kelvin,

How did you do that? your combo box behaviour is exactly what I wanted!

Anson
"Kevin Hodgson" <ke***@caseware.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
I have a DataBound ComboBox, which has a text value as the Value property, and the UniqueID for that value is bound to the Combobox.Tag property.

When a user makes a new selection in the combobox, I need to run a SQL

Query
with the UniqueID of the new value they are picking.

The .SelectedIndexChanged and .SelectedValueChanged events give me the

.Tag
value BEFORE the new selection is made. I'm getting the value for the
previous value, rather than the new value the user has selected.

What order to the various change events occur, and which one will give me the new values, as opposed to the old values?


Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.