add control to a datalist

Discussion in 'ASP .Net' started by Jon Paal, Mar 8, 2006.

  1. Jon   Paal

    Jon Paal Guest

    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 ??
     
    Jon Paal, Mar 8, 2006
    #1
    1. Advertising

  2. Jon maybe try turning them into UserControls.
    Patrick

    "Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message
    news:...
    > 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 ??
    >
    >
     
    Patrick.O.Ige, Mar 8, 2006
    #2
    1. Advertising

  3. <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:...
    >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 ??
    >
     
    Eliyahu Goldin, Mar 9, 2006
    #3
  4. Jon   Paal

    Jon Paal Guest

    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.


    "Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message news:...
    >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 ??
    >
     
    Jon Paal, Mar 9, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nevyn Twyll
    Replies:
    8
    Views:
    1,916
  2. Jameel
    Replies:
    1
    Views:
    710
    =?Utf-8?B?SFA=?=
    Nov 24, 2005
  3. Jon   Paal
    Replies:
    3
    Views:
    631
    Jon Paal
    Mar 19, 2006
  4. simons
    Replies:
    1
    Views:
    662
    =?Utf-8?B?U2l2YSBN?=
    Jun 5, 2007
  5. Chad Scharf
    Replies:
    3
    Views:
    922
    Chad Scharf
    Oct 18, 2007
Loading...

Share This Page