populating a Drop down list

Discussion in 'ASP .Net' started by Casey, Jul 5, 2004.

  1. Casey

    Casey Guest

    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
    Casey, Jul 5, 2004
    #1
    1. Advertising

  2. Casey

    Edward Guest

    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();

    > 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
    >
    >
    Edward, Jul 5, 2004
    #2
    1. Advertising

  3. Casey

    Casey Guest

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

    Until then it should be empty




    >-----Original Message-----
    >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();
    >
    >> 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
    >>
    >>

    >
    >
    >.
    >
    Casey, Jul 5, 2004
    #3
  4. Casey

    Dan Brussee Guest

    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.


    On Mon, 5 Jul 2004 07:28:15 -0700, "Casey"
    <> wrote:

    >
    >
    >What i mean is that the list should only be populated
    >when the user clicks on it.
    >
    >Until then it should be empty
    >
    >
    >
    >
    >>-----Original Message-----
    >>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();
    >>
    >>> 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
    >>>
    >>>

    >>
    >>
    >>.
    >>
    Dan Brussee, Jul 5, 2004
    #4
  5. Casey

    Casey Guest

    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..



    >-----Original Message-----
    >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.
    >
    >
    >On Mon, 5 Jul 2004 07:28:15 -0700, "Casey"
    ><> wrote:
    >
    >>
    >>
    >>What i mean is that the list should only be populated
    >>when the user clicks on it.
    >>
    >>Until then it should be empty
    >>
    >>
    >>
    >>
    >>>-----Original Message-----
    >>>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();
    >>>
    >>>> 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
    >>>>
    >>>>
    >>>
    >>>
    >>>.
    >>>

    >
    >.
    >
    Casey, Jul 5, 2004
    #5
  6. Casey

    Dan Brussee Guest

    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.


    On Mon, 5 Jul 2004 14:19:26 -0700, "Casey"
    <> wrote:

    >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..
    >
    >
    >
    >>-----Original Message-----
    >>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.
    >>
    >>
    >>On Mon, 5 Jul 2004 07:28:15 -0700, "Casey"
    >><> wrote:
    >>
    >>>
    >>>
    >>>What i mean is that the list should only be populated
    >>>when the user clicks on it.
    >>>
    >>>Until then it should be empty
    >>>
    >>>
    >>>
    >>>
    >>>>-----Original Message-----
    >>>>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();
    >>>>
    >>>>> 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
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>>.
    >>>>

    >>
    >>.
    >>
    Dan Brussee, Jul 5, 2004
    #6
  7. Casey

    casey Guest

    thanks for your help dan..

    I will take your advice,

    regards

    casey

    >-----Original Message-----
    >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.
    >
    >
    >On Mon, 5 Jul 2004 14:19:26 -0700, "Casey"
    ><> wrote:
    >
    >>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..
    >>
    >>
    >>
    >>>-----Original Message-----
    >>>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.
    >>>
    >>>
    >>>On Mon, 5 Jul 2004 07:28:15 -0700, "Casey"
    >>><> wrote:
    >>>
    >>>>
    >>>>
    >>>>What i mean is that the list should only be populated
    >>>>when the user clicks on it.
    >>>>
    >>>>Until then it should be empty
    >>>>
    >>>>
    >>>>
    >>>>
    >>>>>-----Original Message-----
    >>>>>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();
    >>>>>
    >>>>>> 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
    >>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>>.
    >>>>>
    >>>
    >>>.
    >>>

    >
    >.
    >
    casey, Jul 5, 2004
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. msnews.microsoft.com

    best method for populating drop down list control?

    msnews.microsoft.com, Aug 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    535
    Fred Newton
    Aug 7, 2004
  2. SirPoonga
    Replies:
    2
    Views:
    735
    Ben Strackany
    Jan 7, 2005
  3. TB
    Replies:
    5
    Views:
    2,846
  4. weiwei
    Replies:
    0
    Views:
    993
    weiwei
    Jan 5, 2007
  5. Replies:
    5
    Views:
    244
Loading...

Share This Page