add control to a datalist

J

Jon Paal

I have a datalist bound to an arraylist holding 3 chart controls.
I want to display the charts in the datalist :

....
dtlcharts.Datasource = arrCharts
dtlcharts.Databind()

....

<asp:datalist id="dtlcharts" runat="server" >
<ItemTemplate>
control1 goes here
</ItemTemplate>
<ItemTemplate>
control2 goes here
</ItemTemplate>
<ItemTemplate>
control3 goes here
</ItemTemplate>
</asp:datalist>

how can I add the 3 controls into the datalist ??
 
E

Eliyahu Goldin

<asp:datalist id="dtlcharts" runat="server" >
<ItemTemplate>
hidden control1 goes here
hidden control2 goes here
hidden control3 goes here
</ItemTemplate>

In ItemDataBound event decide what control should be visible for the item
and make it visible.

Eliyahu
 
J

Jon Paal

my solution, for others who may be interested.

I could not get datalist to work, so I did this:

<table<tr>
<td> <asp:placeholder id="ph1" runat="server" /> </td>
<td> <asp:placeholder id="ph2" runat="server" /> </td>
<td> <asp:placeholder id="ph3" runat="server" /> </td>
</tr></table>

As it turns out, the placeholders will "stack" the additional graphs as they are added, giving me the grid of graphs I was hoping
for.

i.e., each row holds 3 charts, positioned horizontally. "Stacking effect" simulates multiple rows.

Thanks to those who replied.
 

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,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top