473,382 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Combo box BUG

I am encountering a problem with the combo box. This
only happens when using the datasource property, I create
a table with the following values (a, b, c, d).

Step 1. Select the "c" value from the drop down list by
typing "c" into the combo box. Then click off from the
combo to say a button. Have the button populate a text
box with the combo boxes text property.
Result = "a"
Step 2. Repeat step 1, but type in "b" this time.
Result = "c"

I believe that this is a bug in VB.net. I am trying to
find a work around for this issue and would appreciate
any suggestions.
Nov 20 '05 #1
9 1452
Just tested this and it workds ok for me. Post your code !

Regards - OHM
Mark wrote:
I am encountering a problem with the combo box. This
only happens when using the datasource property, I create
a table with the following values (a, b, c, d).

Step 1. Select the "c" value from the drop down list by
typing "c" into the combo box. Then click off from the
combo to say a button. Have the button populate a text
box with the combo boxes text property.
Result = "a"
Step 2. Repeat step 1, but type in "b" this time.
Result = "c"

I believe that this is a bug in VB.net. I am trying to
find a work around for this issue and would appreciate
any suggestions.


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #2
I've tried it msyelf and can't replicate it. First, I add a, b, c , and d
to a combo box. I have a label and a button. I type in c in the combo box,
and press the button which sets the label to the combobox's Text Property.
If I select or type in c, c is what appears in the label. Same for all of
the other letters. In general though, I'd advise against using the text
property, use ..SelectedValue if you are bound to a datasource and have the
ValueMember set, otherwise use SelectedIndex.
HTH,

Bill
"Mark" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
I am encountering a problem with the combo box. This
only happens when using the datasource property, I create
a table with the following values (a, b, c, d).

Step 1. Select the "c" value from the drop down list by
typing "c" into the combo box. Then click off from the
combo to say a button. Have the button populate a text
box with the combo boxes text property.
Result = "a"
Step 2. Repeat step 1, but type in "b" this time.
Result = "c"

I believe that this is a bug in VB.net. I am trying to
find a work around for this issue and would appreciate
any suggestions.

Nov 20 '05 #3
To duplicate try expanding the Dropdown, then type in "c"
then click on the button without collapsing the
dropdown. Btw, it works fine when not using a datasource.

Here is my code

'Load the combo box on form load
Private Sub Form5_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim dtTest As New DataTable()

dtTest.Columns.Add("Desc")
dtTest.Columns.Add("Code")

Dim iX As Int16

For iX = 1 To 10
Dim drRow As DataRow = dtTest.NewRow
drRow("Code") = iX
drRow("Desc") = Chr(64 + iX) & CType(iX,
String)
dtTest.Rows.Add(drRow)
Next

With ComboBoxEx1
.DataSource = dtTest
.DisplayMember = "Desc"
.ValueMember = "Code"
End With
End Sub

Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
TextBox1.Text = ComboBoxEx1.Text
TextBox2.Text = ComboBoxEx1.SelectedValue
End Sub

Nov 20 '05 #4
To duplicate try expanding the Dropdown, then type in "c"
then click on the button without collapsing the
dropdown. Btw, it works fine when not using a datasource.

Here is my code

'Load the combo box on form load
Private Sub Form5_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim dtTest As New DataTable()

dtTest.Columns.Add("Desc")
dtTest.Columns.Add("Code")

Dim iX As Int16

For iX = 1 To 10
Dim drRow As DataRow = dtTest.NewRow
drRow("Code") = iX
drRow("Desc") = Chr(64 + iX) & CType(iX,
String)
dtTest.Rows.Add(drRow)
Next

With ComboBoxEx1
.DataSource = dtTest
.DisplayMember = "Desc"
.ValueMember = "Code"
End With
End Sub

Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
TextBox1.Text = ComboBoxEx1.Text
TextBox2.Text = ComboBoxEx1.SelectedValue
End Sub
-----Original Message-----
Just tested this and it workds ok for me. Post your code !
Regards - OHM
Mark wrote:
I am encountering a problem with the combo box. This
only happens when using the datasource property, I create a table with the following values (a, b, c, d).

Step 1. Select the "c" value from the drop down list by typing "c" into the combo box. Then click off from the
combo to say a button. Have the button populate a text
box with the combo boxes text property.
Result = "a"
Step 2. Repeat step 1, but type in "b" this time.
Result = "c"

I believe that this is a bug in VB.net. I am trying to
find a work around for this issue and would appreciate
any suggestions.


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
.

Nov 20 '05 #5
Please use a Dropdown style combo, the value has to be
typed into the textbox.
-----Original Message-----
Just tested this and it workds ok for me. Post your code !
Regards - OHM
Mark wrote:
I am encountering a problem with the combo box. This
only happens when using the datasource property, I create a table with the following values (a, b, c, d).

Step 1. Select the "c" value from the drop down list by typing "c" into the combo box. Then click off from the
combo to say a button. Have the button populate a text
box with the combo boxes text property.
Result = "a"
Step 2. Repeat step 1, but type in "b" this time.
Result = "c"

I believe that this is a bug in VB.net. I am trying to
find a work around for this issue and would appreciate
any suggestions.


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
.

Nov 20 '05 #6
Please use a Dropdown style combo, the value has to be
typed into the textbox.
-----Original Message-----
I am encountering a problem with the combo box. This
only happens when using the datasource property, I createa table with the following values (a, b, c, d).

Step 1. Select the "c" value from the drop down list by
typing "c" into the combo box. Then click off from the
combo to say a button. Have the button populate a text
box with the combo boxes text property.
Result = "a"
Step 2. Repeat step 1, but type in "b" this time.
Result = "c"

I believe that this is a bug in VB.net. I am trying to
find a work around for this issue and would appreciate
any suggestions.
.

Nov 20 '05 #7
Ok, I see what you mean now. You aren't selecting anything so the
SelectedItem and value are what they originally are, and although the text
has changed, the SelectedIndex changed never fires hence it's the old value.
Write some code behind selectedIndexChanged and you'll see what I mean just
put in Debug.Assert(false) When you follow your instructions, you'll notice
that the assertion never fails because the event isn't being raised.
However, if you click anywhere on there, it does.

Anyway, once selectedindex change is fired, it's good to go, so rather than
a bug it just seems like that sequence doesn't fire the event
"Mark" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
To duplicate try expanding the Dropdown, then type in "c"
then click on the button without collapsing the
dropdown. Btw, it works fine when not using a datasource.

Here is my code

'Load the combo box on form load
Private Sub Form5_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim dtTest As New DataTable()

dtTest.Columns.Add("Desc")
dtTest.Columns.Add("Code")

Dim iX As Int16

For iX = 1 To 10
Dim drRow As DataRow = dtTest.NewRow
drRow("Code") = iX
drRow("Desc") = Chr(64 + iX) & CType(iX,
String)
dtTest.Rows.Add(drRow)
Next

With ComboBoxEx1
.DataSource = dtTest
.DisplayMember = "Desc"
.ValueMember = "Code"
End With
End Sub

Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
TextBox1.Text = ComboBoxEx1.Text
TextBox2.Text = ComboBoxEx1.SelectedValue
End Sub

Nov 20 '05 #8
Cor
Hi Mark,

I could not reproduce the error with your sample.

But what you says looks much like this documentated combobox bug

http://support.microsoft.com/default...b;en-us;814346

I hope this helps?

Cor
I am encountering a problem with the combo box. This
only happens when using the datasource property, I create
a table with the following values (a, b, c, d).

Step 1. Select the "c" value from the drop down list by
typing "c" into the combo box. Then click off from the
combo to say a button. Have the button populate a text
box with the combo boxes text property.
Result = "a"
Step 2. Repeat step 1, but type in "b" this time.
Result = "c"

I believe that this is a bug in VB.net. I am trying to
find a work around for this issue and would appreciate
any suggestions.

Nov 20 '05 #9
Cor
Hi Mark,

Now I could reproduce it, I think I did not understand you.

I changed some code, I thought the error would be bigger, strange enough
with me the error was gone, maybe you can use it.
\\\
Private Sub Form5_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim dtTest As New DataTable
dtTest.Columns.Add("Desc")
dtTest.Columns.Add("Code")
Dim iX As Integer
For iX = 1 To 10
Dim drRow As DataRow = dtTest.NewRow
drRow("Code") = iX
drRow("Desc") = Chr(64 + iX) & CType(iX, String)
dtTest.Rows.Add(drRow)
Next
With ComboBox1
.DataSource = dtTest
.DisplayMember = "Desc"
.ValueMember = "Code"
End With
TextBox1.DataBindings.Add(New Binding("Text", dtTest, "Desc"))
TextBox2.DataBindings.Add(New Binding("Text", dtTest, "Code"))
End Sub
///

Cor
Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
4
by: Heather | last post by:
Hi I am desparately looking for advice in relation to storing the results after selecting items from two combo boxes on a Referral form. The first combo box 'ctl Type' displays a full list of...
6
by: Support4John | last post by:
a2k (9.0.6926) SP-3 Jet 4.0 SP-7 I have a form with combo box field that allows the user to select from the combo box or type in the field value that may or maynot be in the combo box field. ...
2
by: Jeff Mason | last post by:
I'm observing some strange behavior when I use a bound combo box in conjunction with the combo's anchor property. I define a form which contains just a textbox and a combo box. The text box is...
3
by: hmiller | last post by:
Hey everyone, I am having a hell of a time trying to set this menu system up. Here's what I'm trying to do. Combo Box One; is populated by names under properties "row source" "Phase 1"...
9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
2
by: kiranmn75 | last post by:
I want to dynamically populate a combo box through javascript. Data is coming from a array. Sometimes data list may contain items in excess of 2000. Explorer takes more than 5 seconds to...
6
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
2
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.