Condividi tramite


SPFieldLookup.PrependId Property

Gets or sets a Boolean value that specifies whether to add item IDs to the beginning of items listed in selection boxes on forms.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Property PrependId As Boolean
    Get
    Set
'Usage
Dim instance As SPFieldLookup
Dim value As Boolean

value = instance.PrependId

instance.PrependId = value
public bool PrependId { get; set; }

Property Value

Type: System.Boolean
true to add item IDs to items; otherwise, false.

Exceptions

Exception Condition
SPException

Either the AllowMultipleValues property returns false or the LookupField property points to the ID field in the target list.

Remarks

The PrependId property is intended for use with multivalue Lookup fields. Set the property to true to cause each of the field's values to render on New and Edit forms in the format "ID - Value", where ID is the value of the target item's ID field and Value is the value of the field in the target item that is identified by the Lookup field's LookupField property.

See Also

Reference

SPFieldLookup Class

SPFieldLookup Members

Microsoft.SharePoint Namespace