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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to assign the total value of a column to the footer?

How to assign the total value of a column to the footer?

Scheduled Pinned Locked Moved ASP.NET
helpquestiontutorial
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.
  • T Offline
    T Offline
    TeiUKei
    wrote on last edited by
    #1

    Dear all, I was doing a calculation on the total of costs using datagrid. There are only two row in my data. I use the following to insert the summary to the footer but is not success which is as below: For RawCount = 0 To ItemCount - 1 Quantity(RawCount) = Me.dtGrid.Items(RawCount).Cells(2).Text Price(RawCount) = Me.dtGrid.Items(RawCount).Cells(5).Text Costs(RawCount) = Quantity(RawCount) * Price(RawCount) Me.dtGrid.Items(RawCount).Cells(6).Text = Costs(RawCount) TotalQuantity = Quantity(RawCount) + TotalQuantity TotalCost = TotalCost + Costs(RawCount) If Me.dtGrid.Items(RawCount).ItemType = ListItemType.Footer Then Me.dtGrid.Items(RawCount).Cells(2).Text = TotalQuantity End If Could anyone please help me check what is the problem and why the data is not display in my footer raw? Thank you so much for the help!

    G 1 Reply Last reply
    0
    • T TeiUKei

      Dear all, I was doing a calculation on the total of costs using datagrid. There are only two row in my data. I use the following to insert the summary to the footer but is not success which is as below: For RawCount = 0 To ItemCount - 1 Quantity(RawCount) = Me.dtGrid.Items(RawCount).Cells(2).Text Price(RawCount) = Me.dtGrid.Items(RawCount).Cells(5).Text Costs(RawCount) = Quantity(RawCount) * Price(RawCount) Me.dtGrid.Items(RawCount).Cells(6).Text = Costs(RawCount) TotalQuantity = Quantity(RawCount) + TotalQuantity TotalCost = TotalCost + Costs(RawCount) If Me.dtGrid.Items(RawCount).ItemType = ListItemType.Footer Then Me.dtGrid.Items(RawCount).Cells(2).Text = TotalQuantity End If Could anyone please help me check what is the problem and why the data is not display in my footer raw? Thank you so much for the help!

      G Offline
      G Offline
      Gaurav Dudeja India
      wrote on last edited by
      #2

      Please refer from Here[^]

      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