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. total and subtotal in datagrid

total and subtotal in datagrid

Scheduled Pinned Locked Moved ASP.NET
help
3 Posts 3 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.
  • A Offline
    A Offline
    Amit Agarrwal
    wrote on last edited by
    #1

    hello all, I have a Problem i'm showing my total in footer template of datagrid but now i have to display the subtotal just above this footer column or to say within this column but above the total row. hwo can i do this..

    Amit Agarwal

    S I 2 Replies Last reply
    0
    • A Amit Agarrwal

      hello all, I have a Problem i'm showing my total in footer template of datagrid but now i have to display the subtotal just above this footer column or to say within this column but above the total row. hwo can i do this..

      Amit Agarwal

      S Offline
      S Offline
      Spunky Coder
      wrote on last edited by
      #2

      the footer of a datagrid is also a datagrid row...so why don't u add another row above the footer and then give the value to specific column...

      Koushik

      1 Reply Last reply
      0
      • A Amit Agarrwal

        hello all, I have a Problem i'm showing my total in footer template of datagrid but now i have to display the subtotal just above this footer column or to say within this column but above the total row. hwo can i do this..

        Amit Agarwal

        I Offline
        I Offline
        Imran Khan Pathan
        wrote on last edited by
        #3

        Do you want to get the total in footer Template? on RowDataBound Event of gridview,get values of perticular rows and set footer template.

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
        Totalvalues +=convert.ToInt32(((Lable)e.Rows.Findcontrol("lbl")).Text)
        //If you have take Label cotrol
        //Totalvalues is global var and assign 0
        }
        if (e.Row.RowType == DataControlRowType.Footer)
        {
        ((Label)e.Row.FindControl("lblTotal")).Text=Totalvalues.ToString();
        }

        best regard pathan

        please don't forget to vote on the post that helped you.

        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