populating a Drop down list

C

Casey

hello,

I need to populate a drop down list when the user clicks
on the arrow button.

how do i do this.

Should i use a html select control or is it possible
using the asp:dropdownlist
 
E

Edward

Both are ok.

for saving program code, you can choose DropDownList,

if your data come from db, two lines will give your the result
ddl.DataSource = yourProcedure;
ddl.DataBind();
 
C

Casey

What i mean is that the list should only be populated
when the user clicks on it.

Until then it should be empty
 
D

Dan Brussee

Can you supply your reasoning for this requirement? This is not the
normal usage of this type of control. You can certainly populate the
list based on selections from other controls, but it might be
difficult to do using the onclick event of the listbox itself.
 
C

Casey

Dan,

I am connecting to server at a distant location to
retrieve the data for the listbox, and the data has to be
loaded up only when the user wants to look at the
information,

I know there are other ways of doing this but this is
requested by the user

can you give me any ideas on this..
 
D

Dan Brussee

There is a user event that occurs when you click on the dropdown list
I think (not 100% sure). You may be able to link to that. However...

If you are going to go to the server to get the data, this will be a
significant pause to build the list. Also, when you come back, you
would have to manually "open" that list as if you just clicked on it.
Not exactly a smooth transition.

I suggest that you should be able to determine when the list would
need to be built and do this when necessary. Worst case, provide a
button that says "Load List" that the user can click and then populate
the dropdown list.
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top