Reading XML into a DataGrid

  • Thread starter Thread starter Dougie
  • Start date Start date
D

Dougie

I want to create a simple application that reads data from an xml file so
that I can modify it in a user interface. I have heard that I can do this
using DataGrid, but I am unsure on where to start, can anyone please give me
a few pointers? Examples would be appreciated.

Thanks.
 
Take a look at DataSet class. It can be filled with data from xml file, and
write to xml also.

And you can bind it to a DataGrid control

Sunny
 
Dougie:

The DataGrid itself can't do this but you can bind it to a DataSet,
DataTable and/or anything that implements IList. To read in an XML File,
you can use DataSetName.ReadXML(@"Path:\filename.xml");

However, depending on the structure of that file, it may or may not be a
clean implementation so you may need to use an XMLReader and build a
dataobject from there.

HTH,

Bill

www.devbuzz.com
www.knowdotnet.com
 
Back
Top