Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Grouping relevant data together while iterating throug them

Grouping relevant data together while iterating throug them

Scheduled Pinned Locked Moved ASP.NET
sysadmindocker
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    J Cod3r
    wrote on last edited by
    #1

    Hi There, I would like to know if someone can assist me with the following: I need to display data in a tabular format, but I would like to group the relevant data together. In the sample below I am using a asp:repeater to populate a table. The select statement in my code behind file would return data from different employees within different companies ordered by the company name. I want to group all employees from one company together and do a basic summary line before starting with the next company i.e. Number of employees found per company.<asp:repeater id="employeeList" Runat="server"> <HeaderTemplate> <tr> <td width="200"> Company ID </td> <td width="200"> First Name </td> <td width="200"> Last Name </td> <td width="200"> Company </td> </tr> </HeaderTemplate> <ItemTemplate> <tr bgcolor="#ccffff" style="FONT-SIZE: 12px; COLOR: red"> <td><%# DataBinder.Eval(Container.DataItem,"COID") %></td> <td><%# DataBinder.Eval(Container.DataItem,"FIRSTNAME") %></td> <td><%# DataBinder.Eval(Container.DataItem,"LASTNAME") %></td> <td><%# DataBinder.Eval(Container.DataItem,"COMPANY") %></td> </tr> </ItemTemplate> <FooterTemplate> </FooterTemplate> </asp:repeater>
    Regards,

    L 1 Reply Last reply
    0
    • J J Cod3r

      Hi There, I would like to know if someone can assist me with the following: I need to display data in a tabular format, but I would like to group the relevant data together. In the sample below I am using a asp:repeater to populate a table. The select statement in my code behind file would return data from different employees within different companies ordered by the company name. I want to group all employees from one company together and do a basic summary line before starting with the next company i.e. Number of employees found per company.<asp:repeater id="employeeList" Runat="server"> <HeaderTemplate> <tr> <td width="200"> Company ID </td> <td width="200"> First Name </td> <td width="200"> Last Name </td> <td width="200"> Company </td> </tr> </HeaderTemplate> <ItemTemplate> <tr bgcolor="#ccffff" style="FONT-SIZE: 12px; COLOR: red"> <td><%# DataBinder.Eval(Container.DataItem,"COID") %></td> <td><%# DataBinder.Eval(Container.DataItem,"FIRSTNAME") %></td> <td><%# DataBinder.Eval(Container.DataItem,"LASTNAME") %></td> <td><%# DataBinder.Eval(Container.DataItem,"COMPANY") %></td> </tr> </ItemTemplate> <FooterTemplate> </FooterTemplate> </asp:repeater>
      Regards,

      L Offline
      L Offline
      Lea Hayes
      wrote on last edited by
      #2

      Hi, If your data is stored in XML format, you could use XSLT to achieve this. Just in case you are unaware of XSLT, XSLT is an XML based transform language which lets you sort, present, and summarize data which is stored within an XML file. Here is a useful link for getting started: http://www.xml.com/pub/a/2000/08/holman/index.html?page=1[^] I hope that this is of use! Lea Hayes

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups