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. datagrid cell updates

datagrid cell updates

Scheduled Pinned Locked Moved C#
helpquestionannouncement
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.
  • D Offline
    D Offline
    DougW48
    wrote on last edited by
    #1

    I have a datagrid and a dataset...and naturally the source of the datagrid is a table in the dataset. When I type a value into one column, I would like to update the value of another column. For instance, if I was keeping track of items purchased in my table, and I enter the Quantity and Price in respective cells, I would like the next cell to calculate this value and show immediately. I have an expression string to do this in my dataset table, but the datagrid doesn't seem to add the row until I have physically scrolled through all of the columns in the row...so the Total cell doesn't get updated until I actually navigate through it and into the next row. Can I put an expression on the column in my datagrid somehow, or manually do the calculation and set the value into the correct cell? Thanks for the help on this. :)

    M 1 Reply Last reply
    0
    • D DougW48

      I have a datagrid and a dataset...and naturally the source of the datagrid is a table in the dataset. When I type a value into one column, I would like to update the value of another column. For instance, if I was keeping track of items purchased in my table, and I enter the Quantity and Price in respective cells, I would like the next cell to calculate this value and show immediately. I have an expression string to do this in my dataset table, but the datagrid doesn't seem to add the row until I have physically scrolled through all of the columns in the row...so the Total cell doesn't get updated until I actually navigate through it and into the next row. Can I put an expression on the column in my datagrid somehow, or manually do the calculation and set the value into the correct cell? Thanks for the help on this. :)

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      Do you mean DataTable.DisplayExpression and DataColumn.Expression property? Mazy "I think that only daring speculation can lead us further and not accumulation of facts." - Albert Einstein

      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