views:

69

answers:

1

How can I save a ListView with multicolumns into Settings.settings and load them upon running? I'm trying to save a ListView with 3 columns. How can I do that?

+1  A: 
  1. Bind the listview to some data structure.
  2. Serialize is using xmlseriualizer - then you can save the result into the Settings.

Restoring is done using deserialize.

StringWriter output = new StringWriter(new StringBuilder());
XmlSerializer s = new XmlSerializer(this.GetType());
s.Serialize(output,this);
var result = output.ToString()
Dror Helper
Got an example of how I can use XmlSerializer/Deserialize?
Kevin
http://www.dotnetjohn.com/articles.aspx?articleid=173
Dror Helper
Am I required to make an XML file?
Kevin
No - you can save the xml to a string instead - see above
Dror Helper