XmlDataDocument xmlDatadoc = new XmlDataDocument();
xmlDatadoc.DataSet.ReadXml(dir + listBox1.SelectedItem);
DataSet ds = new DataSet("Customer info");
ds = xmlDatadoc.DataSet;
dataGridView1.DataSource = ds.DefaultViewManager;
dataGridView1.DataMember = "Customer";
Now, if the ListBox control "listBox1" is in a different form, say "form1" of the application, how can I get the data and use it in the datagrid in "Form2"?
source
share