0 out of 1 rated this helpful - Rate this topic

SPFieldLookupValue Class

Windows SharePoint Services 3
Contains the value for an SPFieldLookup object.

Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)] 
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public class SPFieldLookupValue
System.Object
  Microsoft.SharePoint.SPFieldLookupValue
     Microsoft.SharePoint.SPFieldUserValue
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
love this control!

Makes getting those pesky lookup values a cinch!

SPFieldLookupValue fieldOne = new SPFieldLookupValue(listItem["Field"].ToString());

more to come on my blog, www.delphi-ts.com/blogs/lozzi.

Optional lookups give different values for "(none)"
If you have an optional lookup column in a list, and it's displayed as a large list, instead of a select, it will save '0;#' instead of null for "(none)" in the value!

A lookup column will have a regular select for display if there is less than 20 items in the list (I have not found any documentation, this is merely an observation), and another display if there are 20 entries or more.