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

C# Combobox SelectedIndexChanged - Combobox clears the selection?

Quick question,

Is there a way to preserve the value in my combobox when it fires a SelectedIndexChanged event?

Right now I have 4 comboboxes all linked together with an SQL query:

Site
City
Manager name
Phone number

When I choose the Site name, the event fires and populates the other three boxes, but clears out the Site name box. Why is that?
Apr 3 '08 #1
4 3343
is this a web application or winform application?
Apr 3 '08 #2
is this a web application or winform application?
Sorry, this is a winform app.
Apr 3 '08 #3
this is a weird behaviour could you post some code?
Apr 3 '08 #4
This is the code I'm using to trigger the combobox update.

Expand|Select|Wrap|Line Numbers
  1. private void comboBox55_SelectedIndexChanged(object sender, EventArgs e)
  2.         {
  3.             this.hD__Site_Name_DataTableAdapter.FillBySite(this.dataSet2.HD__Site_Name_Data, comboBox55.Text);
  4.             this.hD__Requestor_ProfileTableAdapter.FillByPerson(this.dataSet2.HD__Requestor_Profile, comboBox55.Text);
  5.         }
Combobox55 clears after updating the other two boxes with the correct information.
Apr 4 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: George Hartas | last post by:
I am using Visual C# .NET 2003 to make a ComboBox accept both mouse and keyboard selection. For mouse selection code, I double-clicked ComboBox to get the default "comboBox1_SelectedIndexChanged"...
0
by: Hiroyuki Tanaka | last post by:
Hi All, I am trying to develop an application for a touch screen using buttons for the numeric pad with Completion ComboBoxes. At the moment I am having a problem sending the button presses to...
0
by: zfeld | last post by:
I have a ComboBox with the Simple DropDownStyle. when I select an item in the combobox list the SelectedIndexChanged Event and the SelectionChangeCommited Event are fired. When I type something...
1
by: mdb | last post by:
I currently catch the SelectedIndexChanged event on a ComboBox to perform some processing when the user changes the selected item. But I also want to know when the user clears the list, but I...
0
by: Doug | last post by:
This is a repost of an item that I still cannot resolve. I have 3 combo boxes. The first leads to the second to the third. When I have selected a value in the second box, the third box shows...
0
by: peter78 | last post by:
I wanted to implement an autocomplete feature on the combobox where you would type in partial text and it would try to match it for you. It doesn't exist in .Net yet, but I'm guessing it will in...
5
by: Joe | last post by:
Hi I am adding a class to a ComboBox - and all is fine except that I fill the combobox on the Form_Load Method and it causes the method private void comboBox2_SelectedIndexChanged(object...
7
by: samoore33 | last post by:
I am trying to dynamically add items to a listbox or combobox. The items add to either, but when I look through those items, there is nothing there. If I choose an item, it shows up. Not sure...
6
by: tbrown | last post by:
I have a combobox with items like this: {one,two,three}. The selected index is 0, so "one" appears in the combobox text. When the user drops down the list, and selects "two", for example, I...
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: 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...
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...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...

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.