ComboBox - Losing binding

  • Thread starter Thread starter s26f84
  • Start date Start date
S

s26f84

Hey Guys&Gals

my combo box is never empty it always have the text from the first
member of the table... Plz help


my code:

this.cbo.DataSource = SearchData.Tables["Name"];
this.cbo.ValueMember = "ID";
this.cbo.DisplayMember = "Name";
this.cbo.SelectedIndex = -1;
this.cbo.Text = " ";





Sunny
 
It's because it is databound.
If it is databound it will not allow you to put "" as the text because "" is
not in the datasource.
Either put "" in the datasource (in that table) or rethink your use of the
combobox (e.g. use items instead).
 
Thanks Claes, I tried the solution on the link. Its not working most
probably because i am using .NET 1.1.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=855631&SiteID=1

I asked the question in microsoft forum and they told me no solution to
this problem :(

Y me !!!!@#@!#???????????


Claes said:
Not sure what version you're using, but try this:
http://support.microsoft.com/kb/327244

/claes

Hey Guys&Gals

my combo box is never empty it always have the text from the first
member of the table... Plz help


my code:

this.cbo.DataSource = SearchData.Tables["Name"];
this.cbo.ValueMember = "ID";
this.cbo.DisplayMember = "Name";
this.cbo.SelectedIndex = -1;
this.cbo.Text = " ";





Sunny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top