다음을 통해 공유


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

  • keyColumnName
    Type: System.String

    A string indentifying a column in the externalSourceTable parameter whose values uniquely indentify each record. Cannot be a null reference (Nothing in Visual Basic).

  • 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).

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))

See Also

Reference

GridSerializer Class

GridSerializer Members

Microsoft.SharePoint.JSGrid Namespace