简体   繁体   English

序列化DevExpress面板控件

[英]Serializing a DevExpress Panel Control

I have a program with a devexpress PanelControl which contains other data controls (Text box, lists etc'). 我有一个带有devexpress PanelControl的程序,其中包含其他数据控件(文本框,列表等)。 I need to save this panel (All the data that the user entered) to my DB to display it later. 我需要将此面板(用户输入的所有数据)保存到我的数据库中,以便以后显示。 I tried to serialize the PanelControl using BinaryFormatter but the class is not serializable.. Any idea how I can serialize the entire panel? 我尝试使用BinaryFormatter序列化PanelControl,但是该类不可序列化。.任何想法如何可以序列化整个面板? I hate having to access each Text field of every control and append it to a file.. It just seems wrong \\= 我讨厌必须访问每个控件的每个Text字段并将其附加到文件中。这似乎是错误的\\ =

I would suggest that you do not serialize your GUI controls for this purpose. 我建议您不要为此序列化GUI控件。 Perhaps, it is better to adjust bindings and bind your editors to some data? 也许,调整绑定并将您的编辑器绑定到某些数据更好? In this case, you will have to serialize your DataSource, not the GUI, and this looks like a much more better solution... 在这种情况下,您将不得不序列化数据源,而不是GUI,这看起来是更好的解决方案...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM