473,385 Members | 1,464 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,385 software developers and data experts.

ComboBox remains selected after databind

I use several Comboboxes on my Windows Forms that are programmed with
VB.NET and VS 2002. For reasons of convenience, the Comboboxes are
filled by databinding them to a dataset. Everything works fine, except
that all Comboboxes are by default marked (or better: the text shown
is selected). Only after clicking once into each Combobox, they appear
in the usual way unselected or unmarked. Its kind of nothing much
important, but when i open a winform with 10 Comboboxes in it, it
looks quite confusing to all of them marked.

So, how can I get the Comboboxes appearing unmarked after they are
bound to a dataset???

I already tried Refreshing the form after databinding as well as
setting the focus to each of the Comboboxes. Neither of these worked.
Any suggestions???

Thanks all!
Dirk Meusel
Nov 21 '05 #1
5 1509
Dirk,

Probably is it solved when you set the selectedindex two times to -1

It is a known bug.

Cor
Nov 21 '05 #2
Thanks Cor, for your reply, but it does not work either. I tried it
the following way in every combination within the FormLoad Event as
well as after the Oleadapter fills the dataset (which is in a separat
function).

Me.cmb1.SelectedIndex = -1
Me.cmb1.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1

Any more suggestions?

Dirk

"Cor Ligthert" <no**********@planet.nl> wrote in message news:<Oq**************@tk2msftngp13.phx.gbl>...
Dirk,

Probably is it solved when you set the selectedindex two times to -1

It is a known bug.

Cor

Nov 21 '05 #3
Maybe this helps

me.cmb1.SelectionLength = 0
me.cmb2.Selectionlength = 0

hth
gr Peter

dm*@rcs.urz.tu-dresden.de (Dirk Meusel) wrote in message news:<53**************************@posting.google. com>...
Thanks Cor, for your reply, but it does not work either. I tried it
the following way in every combination within the FormLoad Event as
well as after the Oleadapter fills the dataset (which is in a separat
function).

Me.cmb1.SelectedIndex = -1
Me.cmb1.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1

Any more suggestions?

Dirk

"Cor Ligthert" <no**********@planet.nl> wrote in message news:<Oq**************@tk2msftngp13.phx.gbl>...
Dirk,

Probably is it solved when you set the selectedindex two times to -1

It is a known bug.

Cor

Nov 21 '05 #4
Hi Peter,

It worked not out as well, even the combination of both does not have
any effect, I tried:

me.cmb1.SelectionLength = 0
me.cmb2.Selectionlength = 0

as well as:

Me.cmb1.SelectedIndex = -1
Me.cmb1.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1
me.cmb1.SelectionLength = 0
me.cmb2.Selectionlength = 0

thanks, Dirk

************************************************** ***+
From: Piedro
Date Posted: 9/1/2004 5:25:00 AM

Maybe this helps

me.cmb1.SelectionLength = 0
me.cmb2.Selectionlength = 0

hth
gr Peter

dm*@rcs.urz.tu-dresden.de (Dirk Meusel) wrote in message news:<53**************************@posting.google. com>...
Thanks Cor, for your reply, but it does not work either. I tried it
the following way in every combination within the FormLoad Event as
well as after the Oleadapter fills the dataset (which is in a separat
function).

Me.cmb1.SelectedIndex = -1
Me.cmb1.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1

Any more suggestions?

Dirk

"Cor Ligthert" <no**********@planet.nl> wrote in message news:<Oq**************@tk2msftngp13.phx.gbl>...
Dirk,

Probably is it solved when you set the selectedindex two times to -1

It is a known bug.

Cor

Nov 21 '05 #5
Do it after all databinding

"Dirk Meusel" <dm*@rcs.urz.tu-dresden.de> wrote in message
news:53**************************@posting.google.c om...
Thanks Cor, for your reply, but it does not work either. I tried it
the following way in every combination within the FormLoad Event as
well as after the Oleadapter fills the dataset (which is in a separat
function).

Me.cmb1.SelectedIndex = -1
Me.cmb1.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1

Any more suggestions?

Dirk

"Cor Ligthert" <no**********@planet.nl> wrote in message

news:<Oq**************@tk2msftngp13.phx.gbl>...
Dirk,

Probably is it solved when you set the selectedindex two times to -1

It is a known bug.

Cor

Nov 21 '05 #6

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

Similar topics

6
by: Omar | last post by:
When I try to databind my comboBox (specifically field "emplcode") to a filled dataset , the contents of the comboBox displays a bunch of "System.Data.DataRowView". I assume the amount of times...
6
by: Johann Blake | last post by:
I fill a table in a dataset with values that will be used by a combobox for the combobox's items. The combobox is a drop down list that only allows the user to select from the list but not enter...
5
by: Claudio Di Flumeri | last post by:
Hi all, Iive found this bug int the VB combobox and I'd like to know if there is a way to solve it... Put a combobox in a form, and fill it with these 3 items: - athens - berlin - chicago ...
4
by: Joe Schmoe | last post by:
All I want to to be able to take a two-column DataReader (One column with the Item ID number, the other with Item Description text) and load it into a Windows Forms ComboBox (Set to DropDownList...
5
by: Eric A. Johnson | last post by:
Hi Everyone, I am at my wit's end here. I have a combobox (combyQueryTitle) that I need to use in order to select a query for my database project. Therefore, I am using the...
3
by: Magnus | last post by:
Im using a set combobox (ComboBox1) to provide a selection of records from a database table. I have a typed dataset (DataSet1) that contains the typed datatable (DataTable1) that the combobox is...
2
by: Brett Romero | last post by:
After I remove all items from a combobox, the last selected item remains in the display area. I've tried: mycbox.SelectedText = string.Empty; and mycbox.refresh(); How do I clear the...
6
by: Kirsten | last post by:
I’m using VS 2008 I have a bound ComboBox on a form. It is bound to a tblInvoiceHeader. VendorID, and it shows the VendorName. When clicked it displays a list of Vendors. When one is selected it...
11
Frinavale
by: Frinavale | last post by:
This question is going to sound a little crazy but.........How do you set the selected item in a ComboBox? I am populating a ComboBox with a bunch of instances of a custom private class: For...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...

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.