Skip to content

DevExpress-Examples/how-to-implement-a-custom-object-serializer-e2879

13.1.4+
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
CS
 
 
VB
 
 
 
 
 
 
 
 
 
 

Files to look at:

How to implement a custom object serializer

The following example shows how to implement a custom serializer.

Custom serializers are required when data source field values are custom objects (not numeric or string values). In this example, the data source contains a Sales Person field whose values are Employee objects, exposing the FirstName, LastName and Age properties. The Employee class implements the IComparable interface, and overrides the GetHashCode, Equals and ToString methods (required to display and handle custom objects).

The custom serializer is represented by the CustomObjectConverter class, which implements the ICustomObjectConverter interface. The ToString and FromString methods are implemented to serialize and deserialize the Employee objects, respectively. A CustomObjectConverter class instance is assigned to the PivotGridOptionsData.CustomObjectConverter property. It is used for serializing Sales Person field values when pivot grid data is saved to a stream and restored back by an end-user via clicking the Save and Load buttons respectively.


About

.NET, WinForms, XtraPivotGrid Suite

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published