dropdownlistboxes

  • Thread starter Thread starter Eric Effer
  • Start date Start date
E

Eric Effer

Hi

I am a vb.net 2005 newbie, I am trying to get a sample of two
dropdownlistboxes which are connected in a master detail way. Suppose I have
a company ddl then when i select a company i want the second 'employees' ddl
to be populated with only the employees of that company?

thanks for your input

Eric
 
Typically, you would use the SelectedIndexChanged event of the first
dropdown box to call whatever function you would want in order to populate
the second dropdown list. You also need to set the first dropdownlist's
autopostback property to true. This will cause it to fire the
selectedindexchanged event whenever a new item in the dropdownlist is
selected. Don't forget though, you'll need to ensure that you only pass a
valid value to your population funciton. In other words, if you have the
first item of dropdownlist 1 as something like "Choose an Item" with an
empty value, you'll need to check that the value isn't empty before you try
to populate dropdownlist 2.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top