Re: [2.0] dataGridView + XML
That call to Refresh does not do what you want. The Refresh method of a control simply redraws it on screen. It has nothing whatsoever to do with the data it contains.
Forget the grid. All the grid does is display what's in the DataSet. Just call the Clear method of the DataSet to remove all the existing data then ReadXml to repopulate. The grid will automatically display the new data, which is what data binding is for. Also, if the file name is not changing then it should be declared in one place only, as a class level variable.
Re: [2.0] dataGridView + XML
Thanks for your reply, however, it doesnt seem to be working. I load the file on Form1_Load, then i press the update button, (with just the clear() method) which works fine, it clears it and its empty.
But when i add the other code to repopulate the Grid it doesnt seem to reload the XML file. I debug, it loads the file into the grid, great. I change the XML file. Then click the update button, but it doesnt seem to do anything, none of the data i changed in the xml file relfects in the grid.
Did I do something wrong?
Thanks,
Michael
Re: [2.0] dataGridView + XML
Are you saying that no data gets displayed or the data is unchanged? Did you call the DataSet's WriteXml method to save your changes?
Re: [2.0] dataGridView + XML
The data is unchanged. And I'm not editing any data within the application. I open the xml file in notepad or wahtever, change some things and save + close. Then click the update button within the application. Nothing seems to change. Restarting the application does however, see the new xml file/information i changed.
Re: [2.0] dataGridView + XML
Anybody got any other ideas? It's still not 'updating' the dataGridView, and maybe the dataset? with the "new" information from the xml file.. i just dont get it at all..
Thanks,
Michael