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;
它显示了层次结构,但没有正确区分子节点和父节点。我只想查看应该是其子节点链接的根节点。此外,我希望数据网格能够编辑 xml文件。