ketan mevada

ketan mevada

  • 1.5k
  • 216
  • 1.5k

Data Binding in Silverlight combobox Control using XML

Jun 5 2013 8:22 AM
i want  combobox data bind from xml like

abc.xml file

?<?xml version="1.0" encoding="utf-8" standalone="no"?>
<root>
  <domaindatasource name="KOSTENPLDomainDataSource">
    <field name="KOSTENPL_CODE" />
    <field name="VA_KPL_HOOFDCOMPLEX" />
  </domaindatasource>

  <domaindatasource name="KSTDRGERDomainDataSource">
    <field name="KSTDRGER_CODE" />  
  </domaindatasource>




  <domaindatasource name="PersneelDomainDataSource">
    <field name="PERSNEEL_CODE" />  
 <field name="COMBEHEERDER" />
 <field name="CLUSTERMANAGER" />
<field name="ADMBEHEERDER" />
<field name="TECHBEHEERDER" />
<field name="SLEUTELHOUDER" />
<field name="BEHEERDER_CODE" />
  </domaindatasource>


</root>

in this i want to only three value :
name="KOSTENPLDomainDataSource"
name="KSTDRGERDomainDataSource"
name="PersneelDomainDataSource"

i am using this code

 XElement xml = XElement.Load("dataset.xml");
                              XElement save = xml.Elements("root").All();
                foreach (XElement element in save.Descendants("domaindatasource"))
                {
                    cmbcolumn.Items.Add(element.FirstAttribute.Value);
                }