471,325 Members | 1,435 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

2 comboboxes

I want to select text from combobox 1 and have another combox with a list of
different items. Example:

if cb1 is Dell than show me only the laptop for dell on cb2
if cb1 is IBM than show me only the laptop for IBM on cb2

Jul 31 '08 #1
3 1101
On Jul 31, 1:04*pm, freddy <fre...@discussions.microsoft.comwrote:
I want to select text from combobox 1 and have another combox with a listof
different items. Example:

if cb1 is Dell than show me only the laptop for dell on cb2
if cb1 is IBM than show me only the laptop for IBM on cb2
and your question is?

simply handle the selectedIndexChange in cb1 and then repopulate cb2
Jul 31 '08 #2
What do you mean?

This?

cb2.Items.Clear();
if (cb1.Text == "Dell")
{
cb2.Items.Add("Dell option 1");
cb2.Items.Add("Dell option 2");
cb2.Items.Add("Dell option 3");
} else if (cb1.Text == "IBM")
{
cb2.Items.Add("IBM option 1");
cb2.Items.Add("IBM option 2");
cb2.Items.Add("IBM option 3");
}

"freddy" wrote:
I want to select text from combobox 1 and have another combox with a list of
different items. Example:

if cb1 is Dell than show me only the laptop for dell on cb2
if cb1 is IBM than show me only the laptop for IBM on cb2
Jul 31 '08 #3
On Jul 31, 3:50*pm, jp2msft <jp2m...@discussions.microsoft.comwrote:
What do you mean?

This?

cb2.Items.Clear();
if (cb1.Text == "Dell")
{
* cb2.Items.Add("Dell option 1");
* cb2.Items.Add("Dell option 2");
* cb2.Items.Add("Dell option 3");} else if (cb1.Text == "IBM")

{
* cb2.Items.Add("IBM option 1");
* cb2.Items.Add("IBM option 2");
* cb2.Items.Add("IBM option 3");

}
"freddy" wrote:
I want to select text from combobox 1 and have another combox with a list of
different items. Example:
if cb1 is Dell than show me only the laptop for dell on cb2
if cb1 is IBM than show me only the laptop for IBM on cb2- Hide quoted text -

- Show quoted text -
That is in the most primitive form yes. If you have them in a table or
a dataset you can do it in a general way.

Jul 31 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Craig G | last post: by
1 post views Thread by Marcin Podle¶ny | last post: by
6 posts views Thread by Sam | last post: by
2 posts views Thread by Matt | last post: by
5 posts views Thread by Anthony Bollinger | last post: by

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.