Class SerializationController
Represents a controller that is used to perform serialize and deserialize operations in SfDataGrid using DataContractSerializer.
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.DataGrid.Serialization
Assembly: Syncfusion.Grid.WinUI.dll
Syntax
public class SerializationController : Object, IDisposable
Constructors
SerializationController(SfDataGrid)
Initializes a new instance of SerializationController class.
Declaration
public SerializationController(SfDataGrid grid)
Parameters
Type | Name | Description |
---|---|---|
SfDataGrid | grid | 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 DeserializationOptions.
Declaration
public virtual void Deserialize(Stream stream, DeserializationOptions deserializeOptions)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Contains the XML document to deserialize. |
DeserializationOptions | deserializeOptions | Specifies the DeserializationOptions to decide the type of grid operations such as sorting ,filtering ,and etc to be deserialized. |
Dispose()
Releases all the resources used by the SerializationController class.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes all the resources used by the SerializationController class.
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.
GetSerializableDataGrid()
Gets the new instance of SerializableDataGrid while serializing the SfDataGrid.
Declaration
protected virtual SerializableDataGrid GetSerializableDataGrid()
Returns
Type | Description |
---|---|
SerializableDataGrid | The new instance of SerializableDataGrid. |
Remarks
If you need to serialize the custom SfDataGrid properties, you should add these properties to custom SerializableDataGrid class.
GetSerializableGridColumn(GridColumn)
Gets the SerializableGridColumn instance while serializing the SfDataGrid.
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 SerializableGridColumn instance for the specified grid column |
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 SerializableDataGrid with the specified DeserializationOptions during deserialization.
Declaration
protected virtual void ReloadGrid(SerializableDataGrid dataGrid, DeserializationOptions deserializationOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | dataGrid | 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. |
RestoreColumnProperties(SerializableGridColumn, GridColumn)
Restores the grid column properties from the specified SerializableGridColumn to the GridColumn during deserialization.
Declaration
protected virtual void RestoreColumnProperties(SerializableGridColumn serializableColumn, GridColumn column)
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. |
RestoreDetailsViewDefinition(SerializableDataGrid, DeserializationOptions)
Restores the DetailsViewDefinition settings from the SerializableDataGrid with the specified DeserializationOptions during deserialization.
Declaration
protected virtual void RestoreDetailsViewDefinition(SerializableDataGrid serializableDataGrid, DeserializationOptions options)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to restore the DetailsViewDefinition settings. |
DeserializationOptions | options | The deserialization options. |
RestoreFilterPredicates(SerializableDataGrid, DeserializationOptions)
Restores the filter predicates from SerializableDataGrid with the specified DeserializationOptions during deserialization.
Declaration
protected virtual void RestoreFilterPredicates(SerializableDataGrid serializableDataGrid, DeserializationOptions options)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to restore the filter predicates. |
DeserializationOptions | options | Specifies the options for deserializing the filter predicates. |
RestoreGridCaptionSummaryRow(SerializableDataGrid, DeserializationOptions)
Restores the caption summary row settings from the SerializableDataGrid with the specified DeserializationOptions during deserialization.
Declaration
protected virtual void RestoreGridCaptionSummaryRow(SerializableDataGrid serializableDataGrid, DeserializationOptions options)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding serializable DataGrid to restore the caption summary row settings. |
DeserializationOptions | options | Specifies the options for deserializing the caption summary row. |
RestoreGridColumns(SerializableDataGrid, DeserializationOptions)
Restores the grid columns from the SerializableDataGrid with the specified DeserializationOptions during deserialization process.
Declaration
protected virtual void RestoreGridColumns(SerializableDataGrid serializableDataGrid, DeserializationOptions options)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | Restores the columns settings from the SerializableDataGrid. |
DeserializationOptions | options | Contains the deserialization options. |
RestoreGridGroupSummaryRows(SerializableDataGrid, DeserializationOptions)
Restores the group summary rows settings from the SerializableDataGrid with the specified DeserializationOptions during deserialization.
Declaration
protected virtual void RestoreGridGroupSummaryRows(SerializableDataGrid serializableDataGrid, DeserializationOptions options)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding serializable DataGrid to restore the group summary rows settings. |
DeserializationOptions | options | Specifies the options for deserializing the group summary rows. |
RestoreGridProperties(SerializableDataGrid)
Restores grid properties from the specified SerializableDataGrid.
Declaration
protected virtual void RestoreGridProperties(SerializableDataGrid serializableDataGrid)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding serializable DataGrid to restore DataGrid properties for deserialization. |
RestoreGridSettings(SerializableDataGrid, SfDataGrid, DeserializationOptions)
Restores the SfDataGrid settings from the SerializableDataGrid with the specified DeserializationOptions during deserialization process.
Declaration
protected virtual void RestoreGridSettings(SerializableDataGrid serializableDataGrid, SfDataGrid dataGrid, DeserializationOptions options)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding serializable DataGrid to restore the grid settings. |
SfDataGrid | dataGrid | The corresponding SfDataGrid to deserialize its settings. |
DeserializationOptions | options | Specifies the DeserializationOptions for deserializing the grid settings. |
RestoreGridStackedHeaderRows(SerializableDataGrid, DeserializationOptions)
Restores the stacked header rows settings from the SerializableDataGrid with the specified DeserializationOptions during deserialization.
Declaration
protected virtual void RestoreGridStackedHeaderRows(SerializableDataGrid serializableDataGrid, DeserializationOptions options)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to restore the stacked header rows settings. |
DeserializationOptions | options | The deserialization options. |
RestoreGridSummaryRow(SerializableGridSummaryRow, GridSummaryRow)
Restores the grid summary row settings from the SerializableGridSummaryRow to GridSummaryRow during deserialization.
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 SerializableDataGrid with the specified DeserializationOptions during deserialization.
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 SerializableDataGrid with the specified DeserializationOptions during deserialization.
Declaration
protected virtual void RestoreGridUnboundRows(SerializableDataGrid serializableDataGrid, DeserializationOptions options)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to restore the unbound rows settings. |
DeserializationOptions | options | The deserialization options. |
RestoreGroupColumnDescriptions(SerializableDataGrid, DeserializationOptions)
Restores the group column descriptions from the SerializableDataGrid with the specified DeserializationOptions during deserialization.
Declaration
protected virtual void RestoreGroupColumnDescriptions(SerializableDataGrid serializableDataGrid, DeserializationOptions options)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The serializable DataGrid to deserialize the group column descriptions. |
DeserializationOptions | options | Specifies the options for deserializing the group column descriptions. |
RestoreSortColumnDescriptions(SerializableDataGrid, DeserializationOptions)
Restores the sort column descriptions settings from the SerializableDataGrid with the specified DeserializationOptions during deserialization.
Declaration
protected virtual void RestoreSortColumnDescriptions(SerializableDataGrid serializableDataGrid, DeserializationOptions options)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The serializable DataGrid to deserialize the sort column descriptions. |
DeserializationOptions | options | Specifies the options for deserializing the sort column descriptions. |
Serialize(Stream, SerializationOptions)
Serializes the SfDataGrid to the given XML stream based on the specified SerializationOptions.
Declaration
public virtual void Serialize(Stream stream, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Specifies stream used to write XML document file. |
SerializationOptions | serializeOptions | Specifies the SerializationOptions to decide the type of operations such as sorting ,filtering ,and etc to be serialized. |
StoreDetailsViewDefinition(SerializableDataGrid, DetailsViewDefinition, SerializationOptions)
Stores the specified DetailsViewDefinition settings to SerializableDataGrid with the specified SerializationOptions during serialization process.
Declaration
protected virtual void StoreDetailsViewDefinition(SerializableDataGrid serializableDataGrid, DetailsViewDefinition detailsViewDefinition, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to store the DetailsViewDefinition settings. |
DetailsViewDefinition | detailsViewDefinition | The corresponding detailsViewDefinition that need to be stored in to serializableDataGrid for serializing DetailsViewDefinition. |
SerializationOptions | serializeOptions | The corresponding serialization options. |
StoreFilterPredicates(SfDataGrid, SerializationOptions)
Stores the filter predicates to SerializableFilterSettings with the specified SerializationOptions during serialization process.
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 SerializableFilterSettings that contains the specified filter predicates in SfDataGrid. |
StoreGridCaptionSummaryRow(SerializableDataGrid, GridSummaryRow, SerializationOptions)
Stores the specified caption summary row property settings to the SerializableDataGrid with specified SerializationOptions during serialization process.
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)
Stores the grid column properties to the specified SerializableGridColumn during serialization process.
Declaration
protected virtual void StoreGridColumnProperties(GridColumn column, SerializableGridColumn serializableColumn)
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. |
StoreGridColumns(SfDataGrid, SerializationOptions)
Stores the columns settings of SfDataGrid to SerializableColumns with the specified SerializationOptions during serialization process.
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 SerializableColumns that contains the specified property settings of columns. |
StoreGridGroupSummaryRows(SerializableDataGrid, ObservableCollection<GridSummaryRow>, SerializationOptions)
Stores the property settings of group summary rows to the SerializableDataGrid with the specified SerializationOptions during serialization process.
Declaration
protected virtual void StoreGridGroupSummaryRows(SerializableDataGrid serializableDataGrid, ObservableCollection<GridSummaryRow> GroupSummaryrows, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to store the group summary rows property settings. |
System.Collections.ObjectModel.ObservableCollection<GridSummaryRow> | GroupSummaryrows | The collection of grid summary rows that need to be stored in to serializableDataGrid for serializing group summary rows. |
SerializationOptions | serializeOptions | The corresponding serialization options. |
StoreGridProperties(SerializableDataGrid)
Stores the SfDataGrid properties during serialization process.
Declaration
protected virtual void StoreGridProperties(SerializableDataGrid serializableDataGrid)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to store SfDataGrid properties settings. |
StoreGridSettings(SerializationOptions)
Stores the SfDataGrid settings with the specified SerializationOptions to SerializableDataGrid.
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 SerializableDataGrid with grid settings. |
StoreGridStackedHeaderRow(SerializableDataGrid, StackedHeaderRows, SerializationOptions)
Stores the stacked header settings to the SerializableDataGrid during serialization process.
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 SerializableGridSummaryRow during serialization process.
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 SerializableGridSummaryRow contains the GridSummaryRow settings for serialization. |
StoreGridTableSummaryRows(SerializableDataGrid, ObservableCollection<GridSummaryRow>, SerializationOptions)
Stores the property settings of table summary rows to the SerializableDataGrid with the specified SerializationOptions during serialization process.
Declaration
protected virtual void StoreGridTableSummaryRows(SerializableDataGrid serializableDataGrid, ObservableCollection<GridSummaryRow> tableSummaryRows, SerializationOptions serializeOptions)
Parameters
Type | Name | Description |
---|---|---|
SerializableDataGrid | serializableDataGrid | The corresponding SerializableDataGrid to store the table summary rows settings. |
System.Collections.ObjectModel.ObservableCollection<GridSummaryRow> | 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 SerializableDataGrid with the specified SerializationOptions during serialization process.
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 SerializableSortColumnDescriptions with the specified SerializationOptions during serialization process.
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 SerializableGroupColumnDescriptions that contains the specified group column descriptions in SfDataGrid. |
StoreSortColumnDescriptions(SfDataGrid, SerializationOptions)
Stores the sort column descriptions to SerializableSortColumnDescriptions with the specified SerializationOptions during serialization process.
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 SerializableSortColumnDescriptions that contains the specified sort column descriptions in SfDataGrid. |
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()