Hi,
I do not believe the Grid works with XmlDataSource directly because the Grid is two-demension and XmlDataSource is Hierarchical. The easiest way for you to work with XmlData is to use XmlDocument and XPath directly. It will be something like this:
Code: C#
//Load the xml data first
XmlTextReader reader = new XmlTextReader(your_xml_file_name.xml);
XmlDocument doc = new XmlDocument();
doc.Load(reader);
//Get the node list
XmlNodeList nodes = doc.SelectNodes(your_xpath);
//Populate the grid from the node list
grid1.DataSource = nodes;
grid1.DataBind();
The XPath you pass to SelectNodes would dedicate what you wish to feed the Grid. This is similar to the XPath property on XmlDataSource object. In addition to the above code, you would also need to define all Grid columns first and each column’s DataField first. In the case of binding to Xml data, the DataField should be set to the corresponding attribute name.
The data binding is one way only. The Grid does not update the Xml file for you.
Hope this helps.
Thanks!