dynamically updating a datagrid from a XML file c# 3.5

Posted by Farstucker on Stack Overflow See other posts from Stack Overflow or by Farstucker
Published on 2010-04-22T15:11:31Z Indexed on 2010/04/22 15:13 UTC
Read the original article Hit count: 250

Filed under:
|
|
|

I have a datagrid that is populated via XML file when the form loads. Everything is working great but I would like the datagrid to update dynamically when a new order is received (Separate class receives a data stream and updates the file).

Im looking for suggestions on how this should be done. (ie using a timer update every second, or monitor the file using FileSystemWatcher.. etc)

Since where here, I might as well mention that in order to update the datagrid Im clearing the whole data set and Re-reading the file using:

DataSet.Clear();
DataSet.ReadXml("file.xml");
dataGridView1.DataSource = DataSet;

if this is not the proper approach, please offer any alternate suggestions.

© Stack Overflow or respective owner

Related posts about c#

Related posts about datagridview