如何序列化TreeView和DataGridView以及字符串

时间:2015-07-01 18:26:45

标签: c# xml winforms datagridview treeview

我在C#中有一个Windows窗体应用程序。我需要将表单数据保存到xml文件。我可以使用字符串C# Tutorial - XML Serialization

保存本教程中给出的文本框中的所有文本

我无法弄清楚如何将TreeView和DataGridView序列化为相同的xml文件。试过这里给出的解决方案How to serialize treeview in to xml and deserialize xml back to treeview? 但无法将数据保存到单个xml文件中。在反序列化时,字符串将填充在树视图中而不是节点中。

0 个答案:

没有答案