GridSerializer Constructor
Initializes a GridSerializer object.
Namespace: Microsoft.SharePoint.JSGrid
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Sub New ( _
mode As SerializeMode, _
externalSourceTable As DataTable, _
keyColumnName As String, _
sortedColumns As FieldOrderCollection, _
gridFields As IEnumerable(Of GridField), _
gridColumns As IEnumerable(Of GridColumn) _
)
'Usage
Dim mode As SerializeMode
Dim externalSourceTable As DataTable
Dim keyColumnName As String
Dim sortedColumns As FieldOrderCollection
Dim gridFields As IEnumerable(Of GridField)
Dim gridColumns As IEnumerable(Of GridColumn)
Dim instance As New GridSerializer(mode, externalSourceTable, _
keyColumnName, sortedColumns, gridFields, _
gridColumns)
public GridSerializer(
SerializeMode mode,
DataTable externalSourceTable,
string keyColumnName,
FieldOrderCollection sortedColumns,
IEnumerable<GridField> gridFields,
IEnumerable<GridColumn> gridColumns
)
Parameters
mode
Type: Microsoft.SharePoint.JSGrid.SerializeModeIndicates which elements of the configuration and data will be serialized.
externalSourceTable
Type: System.Data.DataTableThe source of data for the grid.
keyColumnName
Type: System.StringA string indentifying a column in the externalSourceTable parameter whose values uniquely indentify each record. Cannot be a null reference (Nothing in Visual Basic).
sortedColumns
Type: Microsoft.SharePoint.JSGrid.FieldOrderCollectionSpecifies the sort configuration to apply to data in the grid.
gridFields
Type: System.Collections.Generic.IEnumerable<GridField>A collection of grid fields. Provides extended information about a subset of the data columns in the externalSourceTable parameter. Cannot be a null reference (Nothing in Visual Basic).
gridColumns
Type: System.Collections.Generic.IEnumerable<GridColumn>A collection of grid columns. Provides extended information about how to display a subset of grid fields.
Remarks
This code snippet demonstrates how to create a grid serializer. The complete code, including the definitions of the field and column data is found in How to: Create a Basic JS Grid Control.
//create a grid serializer to connect to data
GridSerializer gds = new GridSerializer(SerializeMode.Full,
data, "Key", new FieldOrderCollection(new String[] { "Department" }),
GridUtilities.GetGridFields(data), GridUtilities.GetGridColumns(data));
'create a grid serializer to connect to data
Dim gds As New GridSerializer(SerializeMode.Full, data, "Key", New FieldOrderCollection(New String() { "Department" }), GridUtilities.GetGridFields(data), GridUtilities.GetGridColumns(data))