Drop Down List within a Repeater

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

Shiva

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.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top