Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > add control to a datalist

Reply
Thread Tools

add control to a datalist

 
 
Jon Paal
Guest
Posts: n/a
 
      03-08-2006
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 ??


 
Reply With Quote
 
 
 
 
Patrick.O.Ige
Guest
Posts: n/a
 
      03-08-2006
Jon maybe try turning them into UserControls.
Patrick

"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message
news:(E-Mail Removed)...
> 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 ??
>
>



 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      03-09-2006
<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

"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message
news:(E-Mail Removed)...
>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 ??
>



 
Reply With Quote
 
Jon Paal
Guest
Posts: n/a
 
      03-09-2006
my solution, for others who may be interested.

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

<table<tr>
<td> <asplaceholder id="ph1" runat="server" /> </td>
<td> <asplaceholder id="ph2" runat="server" /> </td>
<td> <asplaceholder 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.


"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message news:(E-Mail Removed)...
>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 ??
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
this.Controls.Add(Control) Does Not Add Control to child collection (this.Controls.Count == 0) Chad Scharf ASP .Net 3 10-18-2007 03:53 PM
Add hyper link to DataList Control in ASP.NET 2.0 simons ASP .Net 1 06-05-2007 09:36 AM
add server controls to the templates for the DataList control. Jon Paal ASP .Net 3 03-19-2006 06:09 PM
How to add Label control to DataList? Jameel ASP .Net 1 11-24-2005 08:29 AM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll ASP .Net 8 09-09-2004 10:13 PM



Advertisments