DataGrid bound to DataSet continuously updated by background thread.

  • Thread starter Thread starter R Avery
  • Start date Start date
R

R Avery

I have a dataset that I am updating with a background thread about
once/second. I have a datagrid on a WinForm that is bound to a dataview
on top of a datatable within this dataset.

While it is nice that the grid automatically updates to respond to
changes in the dataset, the constant updating makes the WinForm
unresponsive. Therfore, I would like the ability to toggle off updates,
so that the datagrid no longer responds to the events of the underlying
dataset - so that it just displays a fixed snapshot. I would also like
to be able to programmatically refresh the datagrid to retrieve the
current snapshot.

How do I accomplish this? If there is no way to accomplish this
directly, what would be a good work around? Any help would be most
appreciated.
 
You can keep displayed dataset as separate object. You can copy updated
dataset into displayed one only when you need it. Take a look at clone
(copyto) methods - they might help you here.

HTH
Alex
 
Back
Top