Drop Down List within a Repeater

Discussion in 'ASP .Net' started by Timothy V, Jul 18, 2004.

  1. Timothy V

    Timothy V Guest

    Hi,
    If i have an array of arrays (ie, array of int arrays), and i want to use a
    repeater (for the array) that has a drop down list (for the int arrays), how
    do I do it?

    Thank you very much in advance,

    Tim.
     
    Timothy V, Jul 18, 2004
    #1
    1. Advertising

  2. Timothy V

    Shiva Guest

    Hi,

    Try this:

    In your code behind (probably inside Page_Load),

    RepeaterCtl.DataSource = <your jagged array>; // arrayName[][]
    RepeaterCtl.DataBind();

    And in your .aspx file, have your Repeater control as:

    <asp:Repeater id="RepeaterCtl" runat="server">
    <ItemTemplate>
    <asp:DropDownList runat=server id="ddlX" DataSource='<%#
    (Container.DataItem) %>' />
    </ItemTemplate>
    </asp:Repeater>

    Hope this helps.


    "Timothy V" <> wrote in message
    news:...
    Hi,
    If i have an array of arrays (ie, array of int arrays), and i want to use a
    repeater (for the array) that has a drop down list (for the int arrays), how
    do I do it?

    Thank you very much in advance,

    Tim.
     
    Shiva, Jul 18, 2004
    #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. SirPoonga
    Replies:
    2
    Views:
    783
    Ben Strackany
    Jan 7, 2005
  2. weiwei
    Replies:
    0
    Views:
    1,035
    weiwei
    Jan 5, 2007
  3. msimmons
    Replies:
    0
    Views:
    498
    msimmons
    Jul 16, 2009
  4. Replies:
    5
    Views:
    284
  5. Replies:
    3
    Views:
    297
Loading...

Share This Page