Nesting Repeater or DataList w/in DataGrid

Discussion in 'ASP .Net' started by Sparky Arbuckle, Aug 15, 2005.

  1. I'm sure this question has been posted many times, but I have yet to
    find an answer for it. I am trying to nest a repeater (or datalist)
    inside of a datagrid and am trying to figure out how to nest
    "sub-columns" inside of it. For example:


    Column1

    ArtistName - "DiscTitle"

    Column2

    TrackNumber. TrackName

    Column1 Column2

    AristName1 - "DiscTitle1" 1. song 1
    2. song 2
    3. song 3

    AristName2 - "DiscTitle2" 1. song 1
    2. song 2

    etc....

    I know I need to bind the data using ItemDataBound but have not found
    any VB.NET examples to help get me started. Below is the code for my
    DataGrid. I am also using Visual Studio .NET 2003 Professional
    Edition.

    <asp:DataGrid id = "DataGrid1"
    runat="server"
    AutoGenerateColumns="FALSE">

    <Columns>
    <asp:TemplateColumn HeaderText="">
    <ItemTemplate>
    <%# DataBinder.Eval(Container.DataItem, "ArtistName") %> -
    <%# DataBinder.Eval(Container.DataItem, "DiscTitle") %>
    </ItemTemplate>
    </asp:TemplateColumn>

    </Columns>
    </asp:DataGrid>
     
    Sparky Arbuckle, Aug 15, 2005
    #1
    1. Advertising

  2. here's a Thread i found that may be of assistance
    http://www.daniweb.com/techtalkforums/thread5777.html

    hope that helps

    Remember, google is your friend and will offer you all the examples you
    want, if you know how to find them :)

    "Sparky Arbuckle" <> wrote in message
    news:...
    > I'm sure this question has been posted many times, but I have yet to
    > find an answer for it. I am trying to nest a repeater (or datalist)
    > inside of a datagrid and am trying to figure out how to nest
    > "sub-columns" inside of it. For example:
    >
    >
    > Column1
    >
    > ArtistName - "DiscTitle"
    >
    > Column2
    >
    > TrackNumber. TrackName
    >
    > Column1 Column2
    >
    > AristName1 - "DiscTitle1" 1. song 1
    > 2. song 2
    > 3. song 3
    >
    > AristName2 - "DiscTitle2" 1. song 1
    > 2. song 2
    >
    > etc....
    >
    > I know I need to bind the data using ItemDataBound but have not found
    > any VB.NET examples to help get me started. Below is the code for my
    > DataGrid. I am also using Visual Studio .NET 2003 Professional
    > Edition.
    >
    > <asp:DataGrid id = "DataGrid1"
    > runat="server"
    > AutoGenerateColumns="FALSE">
    >
    > <Columns>
    > <asp:TemplateColumn HeaderText="">
    > <ItemTemplate>
    > <%# DataBinder.Eval(Container.DataItem, "ArtistName") %> -
    > <%# DataBinder.Eval(Container.DataItem, "DiscTitle") %>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    >
    > </Columns>
    > </asp:DataGrid>
    >
     
    Grant Merwitz, Aug 15, 2005
    #2
    1. Advertising

  3. Thanks Grant. I was able to figure out nesting the datagrid inside
    another datagrid. Now I need to know if it is possible to nest a
    datagrid inside of a nested datagrid.
     
    Sparky Arbuckle, Aug 15, 2005
    #3
  4. It should basicly consist of repeating the same process.

    I gather you are binding your grid through the ItemDataBound Command.
    Well,. when you do that, set the new grids ItemDataBound command to a method
    you have created.
    And in that method do the same thing

    HTH

    "Sparky Arbuckle" <> wrote in message
    news:...
    > Thanks Grant. I was able to figure out nesting the datagrid inside
    > another datagrid. Now I need to know if it is possible to nest a
    > datagrid inside of a nested datagrid.
    >
     
    Grant Merwitz, Aug 16, 2005
    #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,972
  2. Shun Duke
    Replies:
    0
    Views:
    422
    Shun Duke
    Nov 2, 2004
  3. Replies:
    3
    Views:
    3,051
  4. PK9

    Nesting a DataGrid inside a Repeater

    PK9, Mar 25, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    134
  5. Trans
    Replies:
    10
    Views:
    328
    Sean O'Halpin
    Sep 16, 2005
Loading...

Share This Page