How to extract XMLElement of selectedItem of ListBox in WPF?

2 posts, 0 answers
  1. Shanmuga
    Shanmuga avatar
    1 posts
    Member since:
    Apr 2015

    Posted 04 Apr 2015 Link to this post

    Problem Background:
    In my WPF application, in one of the window/page contains 3 List Boxes and 1 ComboBox. These 3 ListBoxes are binded with XML dataprovider and there is no issues. I mean when 1st listbox selection changes automatically updates listbox2. In the same way, listbox3 updates as listbox2 changes. These are all worked out in XAMl file alone and there is code-behind except InitializeComponent() and few lines of code for loading this XAML file dynamically using XAMLReader(this is my requirement)

    Problem facing Requirement:OnSelection change event of any of the ListBox, need to populate ComboBox data dynamically( it will fire webservices which is based on above mentioned 3 LisBox selection). For this purpose, in SelectionChange I am trying to get

    ListBoxObj.SelectedItem - Always contains XML tree.(i.e) of type XMLElement

    I have tried all possiblities, everywhere I am getting only XML tree.
    Anyone have any idea, how to extract ListBox selected Item Text from XMLElement?

  2. Nasko
    Nasko avatar
    692 posts

    Posted 08 Apr 2015 Link to this post

    Hi Shanmuga,

    We are not exactly sure that we completely understand your scenario. Could you please provide us some more detailed information? Sending us a code-snippet of how exactly the controls are connected with the XML DataProvider will be of great help for us in order to provide you with a prompt solution if possible.

    We are looking forward to hearing from you.


    See What's Next in App Development. Register for TelerikNEXT.

Back to Top