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. Displaying Summary Data in the Footer

Displaying Summary Data in the Footer

Scheduled Pinned Locked Moved ASP.NET
csharpquestionhtmlasp-netcom
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.
  • B Offline
    B Offline
    blurMember
    wrote on last edited by
    #1

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/GridViewEx03.asp[^] The article link is abit wrong. The link is on GridView Examples for ASP.NET 2.0: Displaying Summary Data in the Footer. I am using .NET 2.0 C# and had learn from that article to display summary data in the footer. protected void GridView4_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { absentTotal += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Category")); } else if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[0].Text = "Total Absent:"; e.Row.Cells[3].Text = absentTotal.ToString("c"); e.Row.Font.Bold = true; } } I then forgetten that my data values for Category is a string values "A", "P" etc. How can I achieved similar way of calculating the row for Category meaning calculating how many A's and P's. Perhaps the footer of the gridview would show: Total Absent (A): 5 Total Present (P): 10

    thanks in advance. Much appreciated.

    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