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. DataGridView Problem

DataGridView Problem

Scheduled Pinned Locked Moved C#
helpc++databasetutorialquestion
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.
  • M Offline
    M Offline
    MNantu
    wrote on last edited by
    #1

    Hi everyone, I've got a problem with my application and i need some help. I use a DataGridView to display the data.Data is being read from a db.I want to get the Sum of each cell under a column.For example: |Bills |Salary |PriceOfAPen ----------------------------------------------------- |500,00$ |300,00$ |50,00$ |400,00$ |300,00$ |50,00$ ----------------------------------------------------- Total: 900,00$ 600,00$ 100,00$ But my output looks like this: |Bills |Salary |PriceOfAPen ----------------------------------------------------- |500,00$ |300,00$ |50,00$ |400,00$ |300,00$ |50,00$ ----------------------------------------------------- Total: 1600,00$ Users can change or add tables so i have to do it when the data is called.Can someone please help me? Thanks already. Sorry for my English by the way as it is not my native language :)

    C K 2 Replies Last reply
    0
    • M MNantu

      Hi everyone, I've got a problem with my application and i need some help. I use a DataGridView to display the data.Data is being read from a db.I want to get the Sum of each cell under a column.For example: |Bills |Salary |PriceOfAPen ----------------------------------------------------- |500,00$ |300,00$ |50,00$ |400,00$ |300,00$ |50,00$ ----------------------------------------------------- Total: 900,00$ 600,00$ 100,00$ But my output looks like this: |Bills |Salary |PriceOfAPen ----------------------------------------------------- |500,00$ |300,00$ |50,00$ |400,00$ |300,00$ |50,00$ ----------------------------------------------------- Total: 1600,00$ Users can change or add tables so i have to do it when the data is called.Can someone please help me? Thanks already. Sorry for my English by the way as it is not my native language :)

      C Offline
      C Offline
      coolestCoder
      wrote on last edited by
      #2

      Hi, You can use the RowCreated event to keep all the columns values in separate variables, and go on adding new values. then set these to the Footer labels. So simple.


      "A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder


      coolestCoder

      1 Reply Last reply
      0
      • M MNantu

        Hi everyone, I've got a problem with my application and i need some help. I use a DataGridView to display the data.Data is being read from a db.I want to get the Sum of each cell under a column.For example: |Bills |Salary |PriceOfAPen ----------------------------------------------------- |500,00$ |300,00$ |50,00$ |400,00$ |300,00$ |50,00$ ----------------------------------------------------- Total: 900,00$ 600,00$ 100,00$ But my output looks like this: |Bills |Salary |PriceOfAPen ----------------------------------------------------- |500,00$ |300,00$ |50,00$ |400,00$ |300,00$ |50,00$ ----------------------------------------------------- Total: 1600,00$ Users can change or add tables so i have to do it when the data is called.Can someone please help me? Thanks already. Sorry for my English by the way as it is not my native language :)

        K Offline
        K Offline
        Keshav V Kamat 0
        wrote on last edited by
        #3

        You could use some variables for particular cell/row accordingly that maintains the total and at the end display the result accordingly.

        Keshav Kamat :) India

        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