473,385 Members | 1,630 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.

Strange behavior data-bound combobox

I am using a data-bound combobox with dropdownstyle set to
dropdownlist. Teh combobox is bound to a bindingsource which is in turn
bound to a table in my database. The table has only 4 rows and I am
using it to display geographical regions - Northeast, Southeast, West,
and Central. In the bindingsource AddNew is set to false.

Whenever I select an item from the combobox I find that the position in
the dropdown list is replaced by the value that was displayed prior to
making the new selection. For example when I start the application and
view the dropdown list I see the following

West
Central
Southeast
Northwest

with West being initially displayed in the textbox. If I select
Southeast the list changes to the following

Southeast
Central
Southeast
Northwest

and Southeast is displayed in the textbox. I can no longer select West
because it is no longer in the dropdown list !!!!

This seems like a bug to me -- or is that how the combobox is supposed
to work? I want my list to be immutable.

What am I doing wrong?

Thanks,

Crazy

Feb 8 '06 #1
2 1939

Crazy Cat wrote:
I am using a data-bound combobox with dropdownstyle set to
dropdownlist. Teh combobox is bound to a bindingsource which is in turn
bound to a table in my database. The table has only 4 rows and I am
using it to display geographical regions - Northeast, Southeast, West,
and Central. In the bindingsource AddNew is set to false.

Whenever I select an item from the combobox I find that the position in
the dropdown list is replaced by the value that was displayed prior to
making the new selection. For example when I start the application and
view the dropdown list I see the following

West
Central
Southeast
Northwest

with West being initially displayed in the textbox. If I select
Southeast the list changes to the following

Southeast
Central
Southeast
Northwest

and Southeast is displayed in the textbox. I can no longer select West
because it is no longer in the dropdown list !!!!

This seems like a bug to me -- or is that how the combobox is supposed
to work? I want my list to be immutable.

What am I doing wrong?

Thanks,
Sorry to respond to myself but I found the solution and wanted to share
it should anyone run into this problem. The problem was that I had set
Data Source and Data Member properties of the data-bound control,
without realizing that the Data Set Manager had set the Text property
under the Databindings properties (it's easy to miss since the Text
property is a sub property of the Databindings and is not visible until
you expand Databindings). Anyways once I set the Text subproperty to
nothing all was fine.
Crazy


Feb 8 '06 #2
CMM
Seems like you have bound the "DataSource" property (which only provides the
list of items) and the Text property (which gets and updates a field in a
dataset) to the same thing. Just a quick guess. They're supposed to be
different.
Feb 8 '06 #3

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

Similar topics

0
by: John Hunter | last post by:
I have a class that uses some extension code I have written and I am trying to track down some memory leaks, which I presume to be in my extension code. The class is question is in a python...
1
by: Mei | last post by:
Hi, I'm running ASP under IIS 6 with Tomcat. During the process, Tomcat will forward to an ASP page with some data and those data will be written to MS SQL and display some information in that...
11
by: Marlene Stebbins | last post by:
Something very strange is going on here. I don't know if it's a C problem or an implementation problem. The program reads data from a file and loads it into two arrays. When xy, x, y, *xlist and...
6
by: leonecla | last post by:
Hi everybody, I'm facing a very very strange problem with a very very simple C program... My goal should be to write to a binary file some numbers (integers), each one represented as a sequence...
0
by: ivb | last post by:
Hi all, I am using DB2 8.1.11.1 on NT with ASP.NET 1.1 When application make connection to database (via ADO.NET), it set "Connection timeout" parameter to 30 seconds. After, when my webpage...
6
by: Joseph Geretz | last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm adding matching pairs of Toolbar buttons and Menu items. All of the buttons and menu items are wired up to send events to...
2
by: Antonio | last post by:
Good morning, everyone. Here is the strange behavior: I have a datagrid (dgPIs) with paging enabled. When I click to view any page in the grid, it runs the private void lnkIPReg method,...
10
by: John Kraft | last post by:
Hello all, I'm experiencing some, imo, strange behavior with the StreamReader object I am using in the code below. Summary is that I am downloading a file from a website and saving it to disk...
3
by: sara | last post by:
Very strange behavior, but I suspect some is A2K and some might be for me to correct. Just trying to see if anyone can help and advise. We have a database that's been running for a few years...
2
by: Victor Lin | last post by:
Now I am now developing a program that base on sqlite3 in python. But there is a strange problem. That is, all data I insert into sqlite database do not goes into file in disk. It is really...
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: 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: 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: 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:
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.