ValueLocalizer Delegate
A delegate representing a method to localize a data value.
Namespace: Microsoft.SharePoint.JSGrid
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Delegate Function ValueLocalizer ( _
row As DataRow, _
value As Object _
) As String
'Usage
Dim instance As New ValueLocalizer(AddressOf HandlerMethod)
public delegate string ValueLocalizer(
DataRow row,
Object value
)
Parameters
row
Type: System.Data.DataRowThe row that contains the data to localize.
value
Type: System.ObjectThe value to localize.
Return Value
Type: System.String
A String representing the localized value.
Remarks
The Localizer determines how we render the underlying data on screen.
//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
Refer to How to: Create a Basic JS Grid Control for more information.