This is a migrated thread and some comments may be shown as answers.

Is it possible to Serialize a DateTimeCollection?

2 Answers 63 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Debbie Wright
Top achievements
Rank 1
Debbie Wright asked on 29 May 2009, 07:58 PM
I'm storing selected dates as a DatetimeCollection in a custom object.
I want to be able to store that object in viewstate, but I've been gettting the Serialization error

"Telerik.Web.UI.Calendar.Collections.DateTimeCollection is not marked as serializable"


i've already marked the class itself as Serializable, is there any way to serialize this?
or should I store the selected dates as an array or some other format?

Thank you
Deb

2 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 01 Jun 2009, 04:15 PM
Hi Debbie,

Unfortunately serializing the RadCalendar's DateTimeCollection is not supported . As the collection does have a reference to the Calendar's instance which owns it, serializing it will require actual calendar control to be serializable too. You will probably agree that this is not a good practice and can lead to may problems.

I hope this information is helpful.

Kind regards,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Debbie Wright
Top achievements
Rank 1
answered on 01 Jun 2009, 07:14 PM
Thank you for the information.
I was using a separate collection, that did not have a calendar reference, so the calendar not being serializable would not have been a problem.
I've changed the code to use an array instead.
Thanks
Deb
Tags
Calendar
Asked by
Debbie Wright
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Debbie Wright
Top achievements
Rank 1
Share this question
or