G
Guest
I have an arraylist of objects. This arraylist is bound to a repeater. That repeater then creates a set of controls like so
<asp:repeater id="garmentRepeater" runat="server" OnItemCommand="Repeater_ButtonClick"><HeaderTemplate><asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 250px; POSITION: absolute; TOP: 80px" runat="server
Width="200px" Height="50px" Font-Names="Impact" Font-Size="Large">Garments on offer</asp:Label></HeaderTemplate><ItemTemplate><table><tr><td
// this control is irrelevan
<asp:Button id="Button" runat="server" title = '<%# DataBinder.Eval(Container.DataItem, "Name") %>' text = "Select" /
// this control is irrelevan
<IMG id = "Image" src = '<%# DataBinder.Eval(Container.DataItem, "ImagePath") %>'/
// this control IS Relevant to my proble
<asp
ropDownList ID = "DropDownColour" DataSource = '<%# DataBinder.Eval(Container.DataItem, "Colours")%>'></asp
ropDownList></td></tr></table></ItemTemplate></asp:repeater
Now you can see from this I am trying to create a drop down list which has the contents of an arraylist that is part of the type of object in the arraylist that the repeater is bound to
e.g
psuedocode
Garment g = new Garment()
g.Name = "Some name"
g.ImagePath = "Image1.jpg"
ArrayList colours = new ArrayList()
colours.Items.Add("White")
colours.Items.Add("Black")
g.Colours = colours
ArrayList myObjects = new ArrayList()
myObjects.Add(g)
garmentRepeater.DataSource = myObjects
DataBind()
As you can see the arraylist that the repeater is bound to contains objects which contain arraylists as well. Is it possible to bind these to a dropdownlist while the repeater is creating them
Many thanks to anyone who read this far or gifts me with a reply
Jax
<asp:repeater id="garmentRepeater" runat="server" OnItemCommand="Repeater_ButtonClick"><HeaderTemplate><asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 250px; POSITION: absolute; TOP: 80px" runat="server
Width="200px" Height="50px" Font-Names="Impact" Font-Size="Large">Garments on offer</asp:Label></HeaderTemplate><ItemTemplate><table><tr><td
// this control is irrelevan
<asp:Button id="Button" runat="server" title = '<%# DataBinder.Eval(Container.DataItem, "Name") %>' text = "Select" /
// this control is irrelevan
<IMG id = "Image" src = '<%# DataBinder.Eval(Container.DataItem, "ImagePath") %>'/
// this control IS Relevant to my proble
<asp


Now you can see from this I am trying to create a drop down list which has the contents of an arraylist that is part of the type of object in the arraylist that the repeater is bound to
e.g

Garment g = new Garment()
g.Name = "Some name"
g.ImagePath = "Image1.jpg"
ArrayList colours = new ArrayList()
colours.Items.Add("White")
colours.Items.Add("Black")
g.Colours = colours
ArrayList myObjects = new ArrayList()
myObjects.Add(g)
garmentRepeater.DataSource = myObjects
DataBind()
As you can see the arraylist that the repeater is bound to contains objects which contain arraylists as well. Is it possible to bind these to a dropdownlist while the repeater is creating them
Many thanks to anyone who read this far or gifts me with a reply
Jax