string filePath = "C:\\Users\\test\\Desktop\\test.xml"; //XmlTextReader r = new XmlTextReader(filePath); dsXML.ReadXml(filePath, XmlReadMode.Auto); dgvXML.AutoGenerateColumns = true; dgvXML.DataSource = dsXML; dgvXML.DataMember = "name";