Datalist HeaderTemplate repeating duplicates? - sort, break, grouping?

Discussion in 'ASP .Net' started by jobs at webdos, Oct 6, 2006.

  1. I have data that looks like this

    prodid fileid date where prodid repeats

    I want report like this

    prodid -
    fileid
    date

    fileid
    date

    fileid
    date

    My Datalist is below, and ofcoure the header shows up as unbound.
    Anybody have an example of how I can do this with a web control.

    I suspect the ansswre might be in datarepeater, but not sure how to
    bind from that

    Also , was wondering, If I have a datasource that returns a single row
    with a single conlumn, is there any way to bind it to a single label
    like : ProcessIdLabel


    <asp:DataList ID="DataList1" runat="server" DataKeyField="ProcessId"
    DataSourceID="SqlDataSource1">
    <ItemTemplate>
    FileName:
    <asp:Label ID="FileNameLabel" runat="server"
    Text='<%# Eval("FileName") %>'></asp:Label><br />
    FileDate:
    <asp:Label ID="FileDateLabel" runat="server"
    Text='<%# Eval("FileDate") %>'></asp:Label><br />
    FileRecords:
    <asp:Label ID="FileRecordsLabel" runat="server"
    Text='<%# Eval("FileRecords") %>'></asp:Label><br />
    <br />
    </ItemTemplate>
    <HeaderTemplate>
    <br />
    ProcessId:
    <asp:Label ID="ProcessIdLabel" runat="server"
    Text='<%# Eval("ProcessId") %>'></asp:Label><br />
    </HeaderTemplate>
    </asp:DataList>
     
    jobs at webdos, Oct 6, 2006
    #1
    1. Advertising

  2. jobs at webdos

    Baski Guest

    What's your output from your existing Datalist code ?

    "jobs at webdos" <> wrote in message
    news:...
    >I have data that looks like this
    >
    > prodid fileid date where prodid repeats
    >
    > I want report like this
    >
    > prodid -
    > fileid
    > date
    >
    > fileid
    > date
    >
    > fileid
    > date
    >
    > My Datalist is below, and ofcoure the header shows up as unbound.
    > Anybody have an example of how I can do this with a web control.
    >
    > I suspect the ansswre might be in datarepeater, but not sure how to
    > bind from that
    >
    > Also , was wondering, If I have a datasource that returns a single row
    > with a single conlumn, is there any way to bind it to a single label
    > like : ProcessIdLabel
    >
    >
    > <asp:DataList ID="DataList1" runat="server" DataKeyField="ProcessId"
    > DataSourceID="SqlDataSource1">
    > <ItemTemplate>
    > FileName:
    > <asp:Label ID="FileNameLabel" runat="server"
    > Text='<%# Eval("FileName") %>'></asp:Label><br />
    > FileDate:
    > <asp:Label ID="FileDateLabel" runat="server"
    > Text='<%# Eval("FileDate") %>'></asp:Label><br />
    > FileRecords:
    > <asp:Label ID="FileRecordsLabel" runat="server"
    > Text='<%# Eval("FileRecords") %>'></asp:Label><br />
    > <br />
    > </ItemTemplate>
    > <HeaderTemplate>
    > <br />
    > ProcessId:
    > <asp:Label ID="ProcessIdLabel" runat="server"
    > Text='<%# Eval("ProcessId") %>'></asp:Label><br />
    > </HeaderTemplate>
    > </asp:DataList>
    >
     
    Baski, Oct 6, 2006
    #2
    1. Advertising

  3. I figured it out.. two nested datalist worked nicely.

    Baski wrote:
    > What's your output from your existing Datalist code ?
    >
    > "jobs at webdos" <> wrote in message
    > news:...
    > >I have data that looks like this
    > >
    > > prodid fileid date where prodid repeats
    > >
    > > I want report like this
    > >
    > > prodid -
    > > fileid
    > > date
    > >
    > > fileid
    > > date
    > >
    > > fileid
    > > date
    > >
    > > My Datalist is below, and ofcoure the header shows up as unbound.
    > > Anybody have an example of how I can do this with a web control.
    > >
    > > I suspect the ansswre might be in datarepeater, but not sure how to
    > > bind from that
    > >
    > > Also , was wondering, If I have a datasource that returns a single row
    > > with a single conlumn, is there any way to bind it to a single label
    > > like : ProcessIdLabel
    > >
    > >
    > > <asp:DataList ID="DataList1" runat="server" DataKeyField="ProcessId"
    > > DataSourceID="SqlDataSource1">
    > > <ItemTemplate>
    > > FileName:
    > > <asp:Label ID="FileNameLabel" runat="server"
    > > Text='<%# Eval("FileName") %>'></asp:Label><br />
    > > FileDate:
    > > <asp:Label ID="FileDateLabel" runat="server"
    > > Text='<%# Eval("FileDate") %>'></asp:Label><br />
    > > FileRecords:
    > > <asp:Label ID="FileRecordsLabel" runat="server"
    > > Text='<%# Eval("FileRecords") %>'></asp:Label><br />
    > > <br />
    > > </ItemTemplate>
    > > <HeaderTemplate>
    > > <br />
    > > ProcessId:
    > > <asp:Label ID="ProcessIdLabel" runat="server"
    > > Text='<%# Eval("ProcessId") %>'></asp:Label><br />
    > > </HeaderTemplate>
    > > </asp:DataList>
    > >
     
    jobs at webdos, Oct 8, 2006
    #3
    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. Fahim
    Replies:
    0
    Views:
    483
    Fahim
    Aug 18, 2006
  2. Andy B.
    Replies:
    0
    Views:
    788
    Andy B.
    Feb 20, 2009
  3. ree32
    Replies:
    5
    Views:
    163
    Gary K
    Sep 23, 2004
  4. Frank Burleigh

    Data "breaks" (or grouping) in repeating controls

    Frank Burleigh, Jul 4, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    101
    Frank Burleigh
    Jul 4, 2006
  5. Navin
    Replies:
    1
    Views:
    702
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page