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

Persistent framework is unable to serialize the DateTimeOffset datatype

1 Answer 51 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Mohan
Top achievements
Rank 1
Mohan asked on 04 Jan 2019, 01:09 PM

While saving the filter descriptors of the gridview (i.e. serializing the gridview to an xml using the PersistentManager.Save(radgridview)), the persistent manager is unable to save the value of the distinct filter value of type DateTimeOffset. 

Here is the part of xml serialization of the SelectedDistinctValues of FilterDescriptors with type DateTimeOffset on radgridview.

 <PV Key="254" TypeKey="-933998283">     

<Value xsi:type="DateTimeOffset" />   

</PV> 

which should Ideally be as follows:

 <PV Key="254" TypeKey="-933998283">     
<Value xsi:type="DateTimeOffset"> 12/8/2018 11:25:59 AM +00:00 </Value>   
</PV> 

This issue is observed on 2017.2.614.45 version.

Can you please provide your insights and resolve this issue?

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 07 Jan 2019, 11:23 AM
Hi Mohan,

The PersistenceFramework is designed to save primitive types and collection of primitive types by default. It seems that the DateTimeOffset wasn't considered as one of the default types. In order to save the this object you can use a custom property provider and implement custom saving mechanism there. Actually, the recommended approach for saving the RadGridView with the PersistenceFramework is to implement a custom property provider so that everything is saved properly (like columns, grouping, filtering, etc.). You can see how to do this in the GridViewSerialization SDK example.

Can you check those resources and let me know if they help?

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
PersistenceFramework
Asked by
Mohan
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or