Treeview not getting updated with the manual changes made to xml file without recompilation

4 posts, 0 answers
  1. Divya
    Divya avatar
    6 posts
    Member since:
    Apr 2014

    Posted 24 Oct 2014 Link to this post

    Hi,

    I am using XmlDataProvider to bind the contents of an xml file to treeview. My question is if I make any changes to xml file manually, do I need to recompile it everytime. Or the application will correctly refer to the Source path where I have updated the xml.


    Thanks
    Divya
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 28 Oct 2014 Link to this post

    Hello Divya,

    Could you please confirm whether the changes you perform over the XML are done runtime, while the RadTreeView is live in a running WPF application ? Basically to refresh its items, the RadTreeView's ItemsSource must be bound to collection which implements INotifyCollectionChanged and INotifyPropertyChanged. Such collection is ObservableCollection. If your changes over the XML are done runtime, probably you need to refresh both the XmlDataProvider and/or the TreeView's ItemsSource.


    Regards,
    Petar Mladenov
    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 WPF is Visual Studio 2017 Ready
  4. Divya
    Divya avatar
    6 posts
    Member since:
    Apr 2014

    Posted 29 Oct 2014 in reply to Petar Mladenov Link to this post

    My changes are not done at runtime. Say for an example. I have my application inside Debug folder and also xml inside Debug\Resources. So when i run my exe my tree view will be populated with data from this xml. I updated my xml by adding a new element/node manually( by right clicking and opening the xml). So next time when I run the application, should I expect my tree view to show this newly added node?

    I found that unless I recompile my application in Visual Studio, my changes are not reflected. But somewhere I read we don't have to recompile, whatever changes we make will be reflected in exe. 

    Please let me know which is the expected behavior ?

    Thanks,
    Divya
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 30 Oct 2014 Link to this post

    Hello Divya,

    Please take a look at our test project. Run it - you will see some books presented by a RadTreeView which is bound with XmlDataProvider. If I change the XML (for example add a book) between application sessions and run the application, the new book will be displayed. This is what I expect and what this application produces. I hope this project can help you. Please feel free to modify it or you can also send us an isolated sample that we can investigate locally. You can open a new support thread in which you can attach archives.

    Regards,
    Petar Mladenov
    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.

     
Back to Top