private void btn1_click(object sender, RoutedEventArgs e)
{
string value1 = cb1.Text.ToString(); string Path1 = GetFolderPath(); btn1.Content = cb1.Text.ToString(); XDocument xdoc = XDocument.Load(Path1 + @"\Africa.xml"); var q = from c in xdoc.Descendants("Africa") orderby ((string)c.Element(cb1.Text).Value) ascending select new { Area = c.Element("Country").Value, //cb1.Text = c.Element(tt).Value //Doesn't work ...What should i do so that the Column name should be the same as the one selected in the Combo-box .. value1 = c.Element(cb1.Text.ToString()).Value // Not working properly...its showing value1 in column }; xdg1.DataSource = q.ToArray(); xdg1.DefaultFieldLayout.Fields[0].Label = "Country"; xdg1.DefaultFieldLayout.Fields[1].Label = cb1.Text.ToString();
string value1 = cb1.Text.ToString();
string Path1 = GetFolderPath();
btn1.Content = cb1.Text.ToString();
XDocument xdoc = XDocument.Load(Path1 + @"\Africa.xml");
var q = from c in xdoc.Descendants("Africa")
orderby ((string)c.Element(cb1.Text).Value) ascending select new { Area = c.Element("Country").Value, //cb1.Text = c.Element(tt).Value //Doesn't work ...What should i do so that the Column name should be the same as the one selected in the Combo-box .. value1 = c.Element(cb1.Text.ToString()).Value // Not working properly...its showing value1 in column };
orderby ((string)c.Element(cb1.Text).Value) ascending
select new
Area = c.Element("Country").Value,
//cb1.Text = c.Element(tt).Value //Doesn't work ...What should i do so that the Column name should be the same as the one selected in the Combo-box ..
value1 = c.Element(cb1.Text.ToString()).Value // Not working properly...its showing value1 in column
};
xdg1.DataSource = q.ToArray();
xdg1.DefaultFieldLayout.Fields[0].Label = "Country";
xdg1.DefaultFieldLayout.Fields[1].Label = cb1.Text.ToString();
}
Joe