0
Answer

Data Binding in Silverlight combobox Control using XML

ketan mevada

ketan mevada

11y
1.2k
1
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);
                }