Solved

Selection driven combos

Posted on 2006-11-15
2
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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