[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

How do I fill a drop down list using an arraylist and repeater?

Richard Price

1/20/2003 10:52:00 PM

<asp:repeater id=RepProducts runat="server">
<ItemTemplate>
<tr class="Text">
<td>
<%# DataBinder.Eval(Container.DataItem, "returnedCode") %>
</td>
<td>
<asp:dropdownlist ID="D1" runat="server"></asp:dropdownlist>
</td>
</tr>
</ItemTemplate>
</asp:repeater>

What I want to do is bind the dropdown list to a value in an arraylist
that I have declared and filled on the VB codebehind. How can this be
done? I can't get it to work.


*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!
1 Answer

Gregor Streng

1/21/2003 1:18:00 PM

0

Hi Richard,

Use a public property in your codebehind to achieve this.

Public ReadOnly Property xy() as arraylist
Get
Return Myarraylist
End Get
End Property

<asp:dropdownlist ID="D1" runat="server" DataSource='<%# xy %>'
DataValueField="" DataTextField ></asp:dropdownlist>


Hope this helps,
Gregor

"Richard Price" <xmlxsl@hotmail.com> wrote in message
news:Ojm$q4MwCHA.1676@TK2MSFTNGP10...
> <asp:repeater id=RepProducts runat="server">
> <ItemTemplate>
> <tr class="Text">
> <td>
> <%# DataBinder.Eval(Container.DataItem, "returnedCode") %>
> </td>
> <td>
> <asp:dropdownlist ID="D1" runat="server"></asp:dropdownlist>
> </td>
> </tr>
> </ItemTemplate>
> </asp:repeater>
>
> What I want to do is bind the dropdown list to a value in an arraylist
> that I have declared and filled on the VB codebehind. How can this be
> done? I can't get it to work.
>
>
> *** Sent via Developersdex http://www.develop... ***
> Don't just participate in USENET...get rewarded for it!