473,769 Members | 2,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1957

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
1155
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 module, not extension code. I notice some strange behavior; perhaps a guru can give me a pointer about what this may mean. If I define the __del__ method in the class C class C: ...lots of other stuff...
1
1327
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 particular ASP page. The Servlet has no unsafe code. The strange thing is that all the data is written correctly in the MS SQL with correct user and related information but the data might become blank or send to different users in that ASP page....
11
1675
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 *ylist are ints or floats there is no apparent problem. If these variables are doubles, the program crashes. Furthermore, the crashes occur only when xlist and ylist are free()ed. When the above variables are doubles and the calls to free() are...
6
8536
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 of 32 bit. I made this stupid trial code: --------------------------------------------- FILE *fout;
0
3574
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 requests database, and query execution time exceeds 30 seconds, the following error reported: ===
6
2273
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 the same method (aka delegate?). I use the Tag property within this method to determine what user action is taking place. Very simple: When adding toolbar button: tbButton.Click += new...
2
287
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, instead of the private void IPchangePage. The lnkIPReg method refers to a linkbutton that I created in the grid. The datagrid properties list the ItemCommand = lnkIPReg and the PageIndexChange
10
2340
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 for further parsing. I know, I could use the WebClient and it would be easier, but I don't have the flexibility I want with it. This code appears to work exactly the way I want unless the user cancels the the background operation. In that...
3
1518
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 with no problems. We continuously add queries and reports. We're up to about 700 queries (no, not all are used and most are parameter queries - the business asks a LOT of questions!), and under 250 reports and fewer than 15 forms. Data is...
2
1717
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 strange.... Why do these data just keep in memory and discarded? All things that really store in file is the table. If I create a table, it would appears in the sqlite file.
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9849
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8861
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7393
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3551
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.