Filter and bind data from xml file

3 posts, 0 answers
  1. Mohammed
    Mohammed avatar
    12 posts
    Member since:
    Dec 2013

    Posted 25 Jun 2014 Link to this post

    Hi,
    I have created a xml file and i need to bind the data from xml file to the combobox.

    Here is my xml file data

    <?xml version="1.0" encoding="UTF-8"?>
    <UserBranches>
      <User Name="Nasik">
        <Branch BranchID="7" BranchName="Al Khuwdh Branch" />
        <Branch BranchID="8" BranchName="Al Seeb Branch" />
        <Branch BranchID="10" BranchName="Ghobra Branch" />
        <Branch BranchID="1" BranchName="Main Branch" />
        <Branch BranchID="3" BranchName="Muttrah Branch" />
        <Branch BranchID="5" BranchName="Nizwa Branch" />
        <Branch BranchID="9" BranchName="Qurm Branch" />
        <Branch BranchID="2" BranchName="Ruwi Branch" />
        <Branch BranchID="6" BranchName="Salalah Branch" />
        <Branch BranchID="4" BranchName="Sohar Branch" />
        <Branch BranchID="11" BranchName="Sur Branch" />
      </User>
      <User Name="admin">
        <Branch BranchID="1" BranchName="Main Branch" />
      </User>
      <User Name="Jamshed">
        <Branch BranchID="3" BranchName="Muttrah Branch" />
        <Branch BranchID="5" BranchName="Nizwa Branch" />
        <Branch BranchID="9" BranchName="Qurm Branch" />
        <Branch BranchID="2" BranchName="Ruwi Branch" />
        <Branch BranchID="6" BranchName="Salalah Branch" />
        <Branch BranchID="4" BranchName="Sohar Branch" />
        <Branch BranchID="11" BranchName="Sur Branch" />
      </User>
      <User Name="Nabhan">
        <Branch BranchID="7" BranchName="Al Khuwdh Branch" />
        <Branch BranchID="8" BranchName="Al Seeb Branch" />
        <Branch BranchID="10" BranchName="Ghobra Branch" />
        <Branch BranchID="1" BranchName="Main Branch" />
        <Branch BranchID="3" BranchName="Muttrah Branch" />
        <Branch BranchID="5" BranchName="Nizwa Branch" />
        <Branch BranchID="9" BranchName="Qurm Branch" />
        <Branch BranchID="2" BranchName="Ruwi Branch" />
        <Branch BranchID="6" BranchName="Salalah Branch" />
        <Branch BranchID="4" BranchName="Sohar Branch" />
        <Branch BranchID="11" BranchName="Sur Branch" />
      </User>
      <User Name="Mohammed">
        <Branch BranchID="7" BranchName="Al Khuwdh Branch" />
        <Branch BranchID="8" BranchName="Al Seeb Branch" />
        <Branch BranchID="1" BranchName="Main Branch" />
        <Branch BranchID="9" BranchName="Qurm Branch" />
        <Branch BranchID="6" BranchName="Salalah Branch" />
        <Branch BranchID="4" BranchName="Sohar Branch" />
        <Branch BranchID="11" BranchName="Sur Branch" />
      </User>
    </UserBranches>

    when i enter 'admin' in textbox i need to load branch under user 'admin'


    Thanks,
    Mohammed


  2. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 27 Jun 2014 Link to this post

    Hello Mohammed,

    I would suggest you to enable the LoadOnDemand mechanism of the RadComboBox, in order to use the ItemsRequested event handler to determine whether the "admin" is filled in the input of the control. Thus you could find the needed nodes in the XML file and create RadComboBoxItems. I have prepared a sample page for you, demonstrating the implementation of the above suggestion.

    Regards,
    Nencho
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mohammed
    Mohammed avatar
    12 posts
    Member since:
    Dec 2013

    Posted 29 Jun 2014 in reply to Nencho Link to this post

    Hi Nencho,
    Thanks a lot for your support.



    Thanks,
    Mohammed
Back to Top