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 - realtime changes

datagridview - realtime changes

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

    Hi, A datagridview is re-populated from a datatable every so often, i.e. every 10 seconds. I am using a timer to trigger the re-population. Now I would like to move a step forward by checking which cells have changed. I would like to know which cell(s) have changed so that particular cell gets a new colour for a few moments. For example if the data in column 5, row 2 has changed then that cell changes colour for a few seconds and the same for any other changed cells. This is basically a realtime application to show the changes as they happen. How does the datagridview allow for such a task? Thanks

    I J 2 Replies Last reply
    0
    • A arkiboys

      Hi, A datagridview is re-populated from a datatable every so often, i.e. every 10 seconds. I am using a timer to trigger the re-population. Now I would like to move a step forward by checking which cells have changed. I would like to know which cell(s) have changed so that particular cell gets a new colour for a few moments. For example if the data in column 5, row 2 has changed then that cell changes colour for a few seconds and the same for any other changed cells. This is basically a realtime application to show the changes as they happen. How does the datagridview allow for such a task? Thanks

      I Offline
      I Offline
      il_masacratore
      wrote on last edited by
      #2

      I think so DataGridView doesn't have something like this. Maybe you will have to implement it...

      Visit my blog at http://dotnetforeveryone.blogspot.com

      1 Reply Last reply
      0
      • A arkiboys

        Hi, A datagridview is re-populated from a datatable every so often, i.e. every 10 seconds. I am using a timer to trigger the re-population. Now I would like to move a step forward by checking which cells have changed. I would like to know which cell(s) have changed so that particular cell gets a new colour for a few moments. For example if the data in column 5, row 2 has changed then that cell changes colour for a few seconds and the same for any other changed cells. This is basically a realtime application to show the changes as they happen. How does the datagridview allow for such a task? Thanks

        J Offline
        J Offline
        jchalfant
        wrote on last edited by
        #3

        I know of no built-in functions that would perform what you are describing. One thing I'm thinking is that you make a copy of the DataTable DataGridViewRowCollection belinging to your DataGridView or before you perform your update. After the update, run through every cell in the new table or collection and compare that with the old one. If it's the same, change the color of the appropriate cell. To save on processes, you restrict your comparison to only the visible rows by using the FirstDisplayedScrollingRowIndex property.

        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