Partager via


ValueLocalizer - Délégué

Un délégué représentant une méthode à localiser une valeur de données.

Espace de noms :  Microsoft.SharePoint.JSGrid
Assembly :  Microsoft.SharePoint (dans Microsoft.SharePoint.dll)

Syntaxe

'Déclaration
Public Delegate Function ValueLocalizer ( _
    row As DataRow, _
    value As Object _
) As String
'Utilisation
Dim instance As New ValueLocalizer(AddressOf HandlerMethod)
public delegate string ValueLocalizer(
    DataRow row,
    Object value
)

Paramètres

Valeur renvoyée

Type : System.String
String représentant la valeur localisée.

Remarques

Le localisateur détermine comment nous rendre les données sous-jacentes à l'écran.

//Add properties based on the type
                if (dc.DataType == typeof(String))
                {
                    gf.PropertyTypeId = "String";
                    /*
                    gf.Localizer = (ValueLocalizer)delegate(DataRow row, object toConvert)
                    {
                        return toConvert.ToString();
                    };
                    /*The Serialization type is a required property */
                    gf.SerializeLocalizedValue = true;
                    gf.SerializeDataValue = false;
                }
'Add properties based on the type
                If dc.DataType Is GetType(String) Then
                    gf.PropertyTypeId = "String"
                   
                    'gf.Localizer = CType(Function(row As DataRow, toConvert As Object) toConvert.ToString(), ValueLocalizer)
                    'The Serialization type is a required property 
                    gf.SerializeLocalizedValue = True
                    gf.SerializeDataValue = False
                End If

Consultez How to: Create a Basic JS Grid pour plus d'informations.

Voir aussi

Référence

Microsoft.SharePoint.JSGrid - Espace de noms