Drop Down List within a Repeater

  • Thread starter Thread starter Timothy V
  • Start date Start date
T

Timothy V

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


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