SPField.ValidateAndParseValue method

When overridden in a derived class, validates and parses the input value and returns a valid object that can be the value of the field.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Overridable Function ValidateAndParseValue ( _
    item As SPListItem, _
    value As String _
) As Object
'Usage
Dim instance As SPField
Dim item As SPListItem
Dim value As String
Dim returnValue As Object

returnValue = instance.ValidateAndParseValue(item, _
    value)
public virtual Object ValidateAndParseValue(
    SPListItem item,
    string value
)

Parameters

  • value
    Type: System.String

    A string with the value to be parsed and returned.

Return value

Type: System.Object
An object that can be assigned to the field as its value.

Exceptions

Exception Condition
ArgumentNullException

Item is a null reference (Nothing in Visual Basic).

Remarks

The default implementation doesn't do any validating, it simply returns the value.

Consider overriding the ParseValue(SPListItem, String) method and calling it as part of your override of this method.

See also

Reference

SPField class

SPField members

Microsoft.SharePoint namespace