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
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
0
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
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
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
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
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.