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
Ignacio Machin ( .NET/ C# MVP ) - 31 Jul 2008 18:38 GMT
> 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
and your question is?
simply handle the selectedIndexChange in cb1 and then repopulate cb2
jp2msft - 31 Jul 2008 20:50 GMT
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");
}
> 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
Ignacio Machin ( .NET/ C# MVP ) - 31 Jul 2008 22:16 GMT
> What do you mean?
>
[quoted text clipped - 20 lines]
>
> - 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.