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. General Programming
  3. C#
  4. Grouping relevant data together while iterating throug them

Grouping relevant data together while iterating throug them

Scheduled Pinned Locked Moved C#
sysadmindocker
1 Posts 1 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>

    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