Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm new into C# and would like to know how I can Serialize and Deserialize dynamically generated controls in a c# UserControl.


If anyone could help me, i'll be very thankful.

Thank you !


What I have tried:

I have successfully done this in windows forms, however i am still unsure after looking around the internet for solutions for UserControls.
Posted
Updated 27-Mar-20 9:51am
v2
Comments
Ralf Meier 27-Mar-20 16:11pm    
I agree with the Solution from Phil.O - but a question :
When you have a Solution for the Form itself - why don't you do the same for the UserControl ? Both are Containers which hold Controls in it's ControlCollection ...

1 solution

You do not serialize the controls themselves, you just serialize the information needed to (re)build them.
 
Share this answer
 
Comments
Maciej Los 27-Mar-20 16:46pm    
5!
phil.o 27-Mar-20 19:57pm    
Thanks Maciej :)
I'm not sure it is sufficient for OP, though; kind of lacking some concrete info here.

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