datagridview - realtime changes
-
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
-
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 think so DataGridView doesn't have something like this. Maybe you will have to implement it...
Visit my blog at http://dotnetforeveryone.blogspot.com
-
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 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.