Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Need help..Can I save this List control and retrive it later ? so that i don't have to enter all values again in editable column and in combobox column.

Thanks in advance.
Posted

1 solution

There are a lot of examples of how to do this on the web. Basically, you need two functions: one that serializes the current contents of the control to an XML file, and one that loads the control by deserializing the file. You can do this either with separate methods that take the control as a parameter or by subclassing the control.

It is a common technique, so there are lots of examples on the web, better than I could offer in a quick answer. It's pretty straightforward, but does require a bit of knowledge about XML and how to read and write XML files.
 
Share this answer
 
Comments
peoria123 19-Nov-12 15:48pm    
Thank you for your reply. I don't know how to read and write file in xml. I am working in vc++ mfc dialogbased application. is serialization is good method for dialogbased application? any alternative method (like get ,set current value)??
(dialog box has 2 tabs ..List control with editable columns and combobox columns on each tab)

Thank you.
Gregory Gadow 19-Nov-12 15:58pm    
XML (eXtensible Mark-up Language) is just a text file that follows specific rules. It is very flexible; there were a few versions of Excel that used XML to store spreadsheets. A full tutorial would be well beyond what can be given as a quick answer, I'm afraid: you will have to do some research to find a solution that works best for you. As for "serialize" and "deserialize", those are just fancy words that mean "convert to and from a text format that can be moved between different types of data structures" including files.
peoria123 20-Nov-12 12:25pm    
Hi Gregory,
Thank you for your reply.
I searched on google about XML file but I don't know which example is appropriate for me.can you please send me a link which will help me or guide me. Is there any other option to save the listcontrol?
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900