Persistent framework is unable to serialize the DateTimeOffset datatype

2 posts, 0 answers
  1. Mohan
    Mohan avatar
    13 posts
    Member since:
    Aug 2017

    Posted 04 Jan 2019 Link to this post

    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" />   


    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>   

    This issue is observed on 2017.2.614.45 version.

    Can you please provide your insights and resolve this issue?

  2. Martin Ivanov
    Martin Ivanov avatar
    2480 posts

    Posted 07 Jan 2019 Link to this post

    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?

    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.
Back to Top