Populating multiple dropdowns

Discussion in 'ASP .Net' started by =?Utf-8?B?QW5keQ==?=, Apr 21, 2005.

  1. What I want to do is to populate multiple dropdowns when editing.
    Presumably...
    a) I should use a DataReader so that I can get each ResultSet for each
    dropdown control, and that should cut down round trips to the server.
    b) I should populate these dropdowns in the DataGrid_EditCommand?
    What I am having problems with is actually referencing the dropdowns on the
    template.
    e.g. I have a dropdown called drpAccessLevels, but I cannot find this
    anywhere.
    Where am I going wrong?

    Many thanks in advance.
    Andy
     
    =?Utf-8?B?QW5keQ==?=, Apr 21, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?QW5keQ==?=

    Brock Allen Guest

    > a) I should use a DataReader so that I can get each ResultSet for each
    > dropdown control, and that should cut down round trips to the server.


    Only as long as you're building a batch SQL statement (like "select * from
    foo; select * from bar") and not calling ExecuteReader twice. Each ExecuteReader
    makes a trip to the DB.

    > b) I should populate these dropdowns in the DataGrid_EditCommand?
    > What I am having problems with is actually referencing the dropdowns
    > on the
    > template.
    > e.g. I have a dropdown called drpAccessLevels, but I cannot find this
    > anywhere.


    Typically you'd do any additional modifications of the row in ItemDataBound
    event off the grid. So then when the DataGridItemEventArgs.Item.ItemType
    == ListItemType.EditItem then you know you're working with the editable row.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen
     
    Brock Allen, Apr 21, 2005
    #2
    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. Damon
    Replies:
    4
    Views:
    519
    Corey O'Mara
    Feb 7, 2004
  2. sck10

    Populating DropDowns

    sck10, Nov 2, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    410
    Steven Cheng[MSFT]
    Nov 15, 2004
  3. Paul D. Fox

    Help, Populating dropdowns via subroutine

    Paul D. Fox, Aug 25, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    425
    Paul D. Fox
    Aug 25, 2005
  4. Anup
    Replies:
    2
    Views:
    446
  5. Anup

    Populating dropdowns client-side?

    Anup, Jun 20, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    127
Loading...

Share This Page