How can I bind the results of my linq to xml query parser to the same gridview. I'm only able to see the last one for the ZAxisCalib/query3.
string[] fileEntries = Directory.GetFiles(@"c:\Sciclone UAC", "*.cfg*");
foreach (string fileName in fileEntries)
{
XDocument doc = XDocument.Load(fileName);
var query = from x in doc.Descendants("XAxisCalib")
select new
{
MaxChild = x.Descendants("Max"),
MinChild = x.Descendants("Min")
};
{
var bs1 = new BindingSource { DataSource = query };
dataGridView1.AutoGenerateColumns = true;
dataGridView1.AutoSize = true;
dataGridView1.DataSource = bs1;
}
var query2 = from y in doc.Descendants("YAxisCalib")
select new
{
MaxChild = y.Descendants("Max"),
MinChild = y.Descendants("Min")
};
var bs2 = new BindingSource { DataSource = query2 };
dataGridView1.AutoGenerateColumns = true;
dataGridView1.AutoSize = true;
dataGridView1.DataSource = bs2;
var query3 = from z in doc.Descendants("ZAxisCalib")
select new
{
MaxChild = z.Descendants("Max"),
MinChild = z.Descendants("Min")
};
var bs3 = new BindingSource { DataSource = query3 };
dataGridView1.AutoGenerateColumns = true;
dataGridView1.AutoSize = true;
dataGridView1.DataSource = bs3;
}