this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataGrid1.DataMember = textBox1.Text.ToString();
this.dataGrid1.Location = new System.Drawing.Point(36, 46);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(364, 532);
this.dataGrid1.TabIndex = 0;
//
this.AutoScaleBaseSize = new System.Drawing.Size(50, 13);
this.ClientSize = new System.Drawing.Size(592, 573);
this.Controls.AddRange(new System.Windows.Forms.Control[] { this.dataGrid1 });
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.ResumeLayout(false);
XmlDataDocument xmlDatadoc = new XmlDataDocument();
xmlDatadoc.DataSet.ReadXml("abcd.xml");
DataSet ds = new DataSet("abc");
ds = xmlDatadoc.DataSet;
dataGrid1.DataSource = ds.DefaultViewManager;
It is showing the hierarchial structure but it is not distinguishing between the child and parent node properly.i only want to see the root node which should be a link to its child node.also,i want the datagrid to be able to edit the xml file.
After reading the Xml in DataSet why dont you set the DataTable rather than the whole DataSet as DataSource of the Grid ?
Adjust the Table index with your appropriate Root table.