This is a migrated thread and some comments may be shown as answers.

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

3 Answers 64 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Divya
Top achievements
Rank 1
Divya asked on 24 Oct 2014, 05:42 PM
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

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 28 Oct 2014, 01:50 PM
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.

 
0
Divya
Top achievements
Rank 1
answered on 29 Oct 2014, 11:07 AM
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
0
Petar Mladenov
Telerik team
answered on 30 Oct 2014, 04:17 PM
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.

 
Tags
TreeView
Asked by
Divya
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Divya
Top achievements
Rank 1
Share this question
or