tags:

views:

166

answers:

2

Hello,

For a .NET 3.5 VS2008 treeview control, where the item labels are set to be editable, how do I save the changes to disk so that I can load them up again when the application restarts?

Thanks

+2  A: 

Here's an article covering serializing and de-serializing a TreeView control using XmlTextWriter and XmlTextReader.

Joey deVilla
A: 

You have to use a serializer .... binary serializers are the fastest and most efficient but are not widely support by non .Net platforms but they support Serializaition events so you get more granualr control over the serialization process. Use a serializer of your choice to save the state or programmitically do it the long way by using a confile file and save all the expanded nodes and re draw it manually. This is a worthwhile academic excerise but not the best way of doing it.

Serialization is a big chapter, read up on it and choose the class that meets your needs. Remember if your application is goiong to be working with non.Net platforms then XML is the way to go or SOAP !!!

IbrarMumtaz