Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / July 2008

Tip: Looking for answers? Try searching our database.

2 comboboxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
freddy - 31 Jul 2008 18:04 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
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.