Solved

Selection driven combos

Posted on 2006-11-15
2
236 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do I bind a WPF ComboBox to an ItemSource using XAML? 2 28
bound data table problem 2 40
How to repeat the data 4 30
Convert VB web project to C# 3 32
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…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

713 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