Solved

Selection driven combos

Posted on 2006-11-15
2
232 Views
Last Modified: 2010-04-16
Hi,

I have 2 c# winform dot net 1.1 combo's. Both are data bound to the results of a SQL select statement executed on my sybase database. What I want to do is implement functionality where by selecting one of the values in combo1 forces the selected index of combo2 to be changed and display a different value by default, but allow the user to edit the selected index of combo 2 if need be.

Is this possible. As ever your help is really appreciated.

Thanks
0
Comment
Question by:bowemc
  • 2
2 Comments
 
LVL 15

Accepted Solution

by:
ozymandias earned 55 total points
ID: 17948186
create a method like this :

private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e) {
     // set the selected index of comboxbox2 to what ever you like here
}

and bind it to the selectedInbdexChanged event like this :

this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 17948197
Using the above, whenever the selected index of comboxbox1 chnages the method will be called and you can set the selectedindex of combobox2 accordingly.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now