Class SerializationController
Represents a controller that is used to perform serialize and deserialize operations in SfDataGrid using DataContractSerializer.
Inheritance
Inherited Members
Namespace: Syncfusion.WinForms.DataGrid.Serialization
Assembly: Syncfusion.SfDataGrid.WinForms.dll
Syntax
public class SerializationController
Constructors
SerializationController(SfDataGrid)
Initializes a new instance of the SerializationController class.
Declaration
public SerializationController(SfDataGrid dataGrid)
Parameters
Type | Name | Description |
---|---|---|
SfDataGrid | dataGrid | The SfDataGrid. |
Properties
DataGrid
Gets the reference to the SfDataGrid control.
Declaration
public SfDataGrid DataGrid { get; }
Property Value
Type |
---|
SfDataGrid |
Methods
Deserialize(Stream, DeserializationOptions)
Deserializes the SfDataGrid from the given XML stream based on the specified
Declaration
public virtual void Deserialize(Stream stream, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Contains the XML document to deserialize. |
DeserializationOptions | deserializationOptions | Specifies the |
Dispose()
Releases all the resources used by the
Declaration
public void Dispose()
Dispose(Boolean)
Disposes all the resources used by the
Declaration
protected virtual void Dispose(bool isDisposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isDisposing | Indicates whether the call is from Dispose method or from a finalizer. |
GetGridColumn(SerializableGridColumn)
Gets the GridColumn from the SerializableGridColumn during deserialization process.
Declaration
protected virtual GridColumn GetGridColumn(SerializableGridColumn serializableColumn)
Parameters
Type | Name | Description |
---|---|---|
SerializableGridColumn | serializableColumn | The serializable column to get its grid column. |
Returns
Type | Description |
---|---|
GridColumn | Returns the GridColumn. |
Remarks
Override this method to get the custom column during deserialization process.
GetSerializableGridColumn(GridColumn)
Gets the
Declaration
protected virtual SerializableGridColumn GetSerializableGridColumn(GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
GridColumn | column | The corresponding column to get serializable grid column. |
Returns
Type | Description |
---|---|
SerializableGridColumn | Returns the |
Remarks
You can use this method while serializing the custom column.
KnownTypes()
Gets the known column types to serialize and deserialize the columns in SfDataGrid.
Declaration
public virtual Type[] KnownTypes()
Returns
Type | Description |
---|---|
System.Type[] | Returns the corresponding column type. |
Remarks
If you want to serialize the custom columns, its types should be added in the returned Type Array.
ReloadGrid(SerializableDataGrid, DeserializationOptions)
Reloads the grid properties from the
Declaration
protected virtual void ReloadGrid(SerializableDataGrid serializableDataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to restore the grid settings. |
DeserializationOptions | deserializationOptions | The deserialization options. |
RestoreColumnFilterPredicates(Object)
Restores the column filter predicates from the DataGrid filter predicates or serializable DataGrid filter settings.
Declaration
protected virtual void RestoreColumnFilterPredicates(dynamic dataGridFilterSettings)
Parameters
Type | Name | Description |
---|---|---|
System.Object | dataGridFilterSettings | The corresponding DataGrid filter settings for deserializing filter predicates. |
RestoreDetailsViewDefinitions(SerializableDataGrid, DeserializationOptions)
Restores the DetailsViewDefinitions settings from the SerializableDataGrid with the specified DeserializationOptions during deserialization.
Declaration
protected virtual void RestoreDetailsViewDefinitions(SerializableDataGrid serializableDataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to restore the DetailsViewDefinitions settings. |
DeserializationOptions | deserializationOptions | The deserialization options. |
RestoreFilterPredicates(SerializableDataGrid, DeserializationOptions)
Restores the filter predicates from
Declaration
protected virtual void RestoreFilterPredicates(SerializableDataGrid serializableDataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to restore the filter predicates. |
DeserializationOptions | deserializationOptions | Specifies the options for deserializing the filter predicates. |
RestoreGridCaptionSummaryRow(SerializableDataGrid, DeserializationOptions)
Restores the caption summary row settings from the
Declaration
protected virtual void RestoreGridCaptionSummaryRow(SerializableDataGrid serializableDataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding serializable DataGrid to restore the caption summary row settings. |
DeserializationOptions | deserializationOptions | Specifies the options for deserializing the caption summary row. |
RestoreGridColumnProperties(SerializableGridColumn, GridColumn, DeserializationOptions)
Restores the grid column properties from the specified
Declaration
protected virtual void RestoreGridColumnProperties(SerializableGridColumn serializableColumn, GridColumn column, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableGridColumn | serializableColumn | The corresponding SerializableGridColumn to restore the grid column properties. |
GridColumn | column | The corresponding column to restore its properties for deserialization. |
DeserializationOptions | deserializationOptions | Contains the deserialization options. |
RestoreGridColumns(SerializableDataGrid, DeserializationOptions)
Restores the grid columns from the
Declaration
protected virtual void RestoreGridColumns(SerializableDataGrid serializableDataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | Restores the columns settings from the SerializableDataGrid. |
DeserializationOptions | deserializationOptions | Contains the deserialization options. |
RestoreGridGroupSummaryRows(SerializableDataGrid, DeserializationOptions)
Restores the group summary rows settings from the
Declaration
protected virtual void RestoreGridGroupSummaryRows(SerializableDataGrid serializableDataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding serializable DataGrid to restore the group summary rows settings. |
DeserializationOptions | deserializationOptions | Specifies the options for deserializing the group summary rows. |
RestoreGridProperties(SerializableDataGrid, DeserializationOptions)
Restores grid properties from the specified
Declaration
protected virtual void RestoreGridProperties(SerializableDataGrid serializableDataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding serializable DataGrid to restore DataGrid properties for deserialization. |
DeserializationOptions | deserializationOptions | Specifies the |
RestoreGridSettings(SerializableDataGrid, DeserializationOptions)
Restores the SfDataGrid settings from the
Declaration
protected virtual void RestoreGridSettings(SerializableDataGrid serializableDataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding serializable DataGrid to restore the grid settings. |
DeserializationOptions | deserializationOptions | Specifies the |
RestoreGridStackedHeaderRows(SerializableDataGrid, DeserializationOptions)
Restores the stacked header rows settings from the
Declaration
protected virtual void RestoreGridStackedHeaderRows(SerializableDataGrid serializableDataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to restore the stacked header rows settings. |
DeserializationOptions | deserializationOptions | The deserialization options. |
RestoreGridSummaryRow(SerializableGridSummaryRow, GridSummaryRow)
Restores the grid summary row settings from the
Declaration
protected virtual GridSummaryRow RestoreGridSummaryRow(SerializableGridSummaryRow serializableGridSummaryRow, GridSummaryRow summaryRow = null)
Parameters
Type | Name | Description |
---|---|---|
SerializableGridSummaryRow | serializableGridSummaryRow | The corresponding SerializableGridSummaryRow to restore the summary row settings. |
GridSummaryRow | summaryRow | The corresponding summary row to restore its settings for deserialization. |
Returns
Type | Description |
---|---|
GridSummaryRow | Returns the GridSummaryRow. |
RestoreGridTableSummaryRows(SerializableDataGrid, DeserializationOptions)
Restores the table summary rows settings from the
Declaration
protected virtual void RestoreGridTableSummaryRows(SerializableDataGrid serializableDataGrid, DeserializationOptions options)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to restore the table summary rows settings. |
DeserializationOptions | options | Specifies the options for deserializing the table summary rows. |
RestoreGridUnBoundRows(SerializableDataGrid, DeserializationOptions)
Restores the unbound rows settings from the
Declaration
protected virtual void RestoreGridUnBoundRows(SerializableDataGrid serializableDataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to restore the unbound rows settings. |
DeserializationOptions | deserializationOptions | The deserialization options. |
RestoreGroupColumnDescriptions(SerializableDataGrid, DeserializationOptions)
Restores the group column descriptions from the
Declaration
protected virtual void RestoreGroupColumnDescriptions(SerializableDataGrid serializableDataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The serializable DataGrid to deserialize the group column descriptions. |
DeserializationOptions | deserializationOptions | Specifies the options for deserializing the group column descriptions. |
RestoreSortColumnDescriptions(SerializableDataGrid, DeserializationOptions)
Restores the sort column descriptions settings from the
Declaration
protected virtual void RestoreSortColumnDescriptions(SerializableDataGrid serializableDataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The serializable DataGrid to deserialize the sort column descriptions. |
DeserializationOptions | deserializationOptions | Specifies the options for deserializing the sort column descriptions. |
Serialize(Stream, SerializationOptions)
Serializes the SfDataGrid to the given XML stream based on the specified
Declaration
public virtual void Serialize(Stream stream, SerializationOptions serializationOptions)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Specifies stream used to write XML document file. |
SerializationOptions | serializationOptions | Specifies the |
StoreDetailsViewDefinitions(SerializableDataGrid, DetailsViewDefinitions, SerializationOptions)
Stores the specified DetailsViewDefinition settings to SerializableDataGrid with the specified SerializationOptions during serialization process.
Declaration
protected virtual void StoreDetailsViewDefinitions(SerializableDataGrid serializableDataGrid, DetailsViewDefinitions detailsViewDefinitions, SerializationOptions serializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to store the DetailsViewDefinition settings. |
DetailsViewDefinitions | detailsViewDefinitions | The corresponding detailsViewDefinitions that need to be stored in to serializableDataGrid for serializing DetailsViewDefinition. |
SerializationOptions | serializationOptions | The corresponding serialization options. |
StoreFilterPredicates(SfDataGrid, SerializationOptions)
Stores the filter predicates to
Declaration
protected virtual SerializableFilterSettings StoreFilterPredicates(SfDataGrid dataGrid, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SfDataGrid | dataGrid | The corresponding SfDataGrid to serialize the filter predicates settings. |
SerializationOptions | serializeOptions | The corresponding serialization options. |
Returns
Type | Description |
---|---|
SerializableFilterSettings | Returns the |
StoreGridCaptionSummaryRow(SerializableDataGrid, GridSummaryRow, SerializationOptions)
Stores the specified caption summary row property settings to the
Declaration
protected virtual void StoreGridCaptionSummaryRow(SerializableDataGrid serializableDataGrid, GridSummaryRow gridSummaryRow, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to store the caption summary row property settings for serialization. |
GridSummaryRow | gridSummaryRow | The corresponding GridSummaryRow to store its settings. |
SerializationOptions | serializeOptions | The corresponding serialization options. |
StoreGridColumnProperties(GridColumn, SerializableGridColumn, SerializationOptions)
Stores the grid column properties to the specified
Declaration
protected virtual void StoreGridColumnProperties(GridColumn column, SerializableGridColumn serializableColumn, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
GridColumn | column | The corresponding column to store it property settings for serialization. |
SerializableGridColumn | serializableColumn | The corresponding SerializableGridColumn where the column properties are stored. |
SerializationOptions | serializeOptions | The corresponding serialization options. |
StoreGridColumns(SfDataGrid, SerializationOptions)
Stores the columns settings of SfDataGrid to
Declaration
protected virtual SerializableColumns StoreGridColumns(SfDataGrid dataGrid, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SfDataGrid | dataGrid | The corresponding dataGrid to store its columns settings for serialization. |
SerializationOptions | serializeOptions | The corresponding serialization options. |
Returns
Type | Description |
---|---|
SerializableColumns | Returns the |
StoreGridGroupSummaryRows(SerializableDataGrid, SerializationOptions)
Stores the property settings of group summary rows to the
Declaration
protected virtual void StoreGridGroupSummaryRows(SerializableDataGrid serializableDataGrid, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to store the group summary rows property settings. |
SerializationOptions | serializeOptions | The corresponding serialization options. |
StoreGridProperties(SerializableDataGrid, SerializationOptions)
Stores the SfDataGrid properties during serialization process.
Declaration
protected virtual SerializableDataGrid StoreGridProperties(SerializableDataGrid serializableDataGrid, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding |
SerializationOptions | serializeOptions | The corresponding serialization options. |
Returns
Type | Description |
---|---|
SerializableDataGrid | Returns the SerializableDataGrid |
StoreGridSettings(SerializationOptions)
Stores the SfDataGrid settings with the specified
Declaration
protected virtual SerializableDataGrid StoreGridSettings(SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializationOptions | serializeOptions | Specifies the serialization options to store grid settings. |
Returns
Type | Description |
---|---|
SerializableDataGrid | Returns the |
StoreGridStackedHeaderRow(SerializableDataGrid, StackedHeaderRows, SerializationOptions)
Stores the stacked header settings to the
Declaration
protected virtual void StoreGridStackedHeaderRow(SerializableDataGrid serializableDataGrid, StackedHeaderRows stackedHeaderRows, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding serializable DataGrid to store the grid stacked header rows. |
StackedHeaderRows | stackedHeaderRows | The corresponding stacked header rows that need to be copied to serializable DataGrid for serialization. |
SerializationOptions | serializeOptions | The corresponding serialization options. |
StoreGridSummaryRow(GridSummaryRow, SerializableGridSummaryRow)
Stores the specified GridSummaryRow properties to the
Declaration
protected virtual SerializableGridSummaryRow StoreGridSummaryRow(GridSummaryRow gridSummaryRow, SerializableGridSummaryRow serializableSummaryRow = null)
Parameters
Type | Name | Description |
---|---|---|
GridSummaryRow | gridSummaryRow | The corresponding grid summary row to store its settings. |
SerializableGridSummaryRow | serializableSummaryRow | The corresponding SerializableGridSummaryRow to store the settings of grid summary row. |
Returns
Type | Description |
---|---|
SerializableGridSummaryRow | Returns the |
StoreGridTableSummaryRows(SerializableDataGrid, ObservableCollection<GridTableSummaryRow>, SerializationOptions)
Stores the property settings of table summary rows to the
Declaration
protected virtual void StoreGridTableSummaryRows(SerializableDataGrid serializableDataGrid, ObservableCollection<GridTableSummaryRow> tableSummaryRows, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to store the table summary rows settings. |
System.Collections.ObjectModel.ObservableCollection<GridTableSummaryRow> | tableSummaryRows | The collection of table summary rows that need to be stored in to SerializableDataGrid for serializing table summary rows. |
SerializationOptions | serializeOptions | The corresponding serialization options. |
StoreGridUnBoundRows(SerializableDataGrid, UnboundRows, SerializationOptions)
Stores the property settings of unbound rows to the
Declaration
protected virtual void StoreGridUnBoundRows(SerializableDataGrid serializableDataGrid, UnboundRows gridUnBoundRows, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding serializableDataGrid to store the unbound rows settings. |
UnboundRows | gridUnBoundRows | The corresponding unbound rows that need to be stored in to SerializableDataGrid for serializing unbound rows. |
SerializationOptions | serializeOptions | The corresponding serialization options. |
StoreGroupColumnDescriptions(SfDataGrid, SerializationOptions)
Stores the group column descriptions to
Declaration
protected virtual SerializableGroupColumnDescriptions StoreGroupColumnDescriptions(SfDataGrid dataGrid, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SfDataGrid | dataGrid | The corresponding SfDataGrid to serialize its group column descriptions. |
SerializationOptions | serializeOptions | The corresponding serialization options. |
Returns
Type | Description |
---|---|
SerializableGroupColumnDescriptions | Returns the |
StoreSortColumnDescriptions(SfDataGrid, SerializationOptions)
Stores the sort column descriptions to
Declaration
protected virtual SerializableSortColumnDescriptions StoreSortColumnDescriptions(SfDataGrid dataGrid, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SfDataGrid | dataGrid | The corresponding SfDataGrid to serialize its sort column descriptions property settings. |
SerializationOptions | serializeOptions | The corresponding serialization options. |
Returns
Type | Description |
---|---|
SerializableSortColumnDescriptions | Returns the |
UnWireSerializablePropertyEvents()
Unwires the events associates with the serializable property.
Declaration
protected virtual void UnWireSerializablePropertyEvents()
WireSerializablePropertyEvents()
Wires the events associates with the serializable property.
Declaration
protected virtual void WireSerializablePropertyEvents()