SPListItem: Get the Display-Value of a lookup field

by Christoph Keller 3. January 2011 14:17
To get the configured Display Value of a Field in a SPListItem, use the following Code: new SPFieldLookupValue(SelectedListItem["FIELDNAME"] as String).LookupValue Another way would be: SelectedListItem.GetFormattedValue("FIELDNAME") The second snipped displays also a hyperlink to item in the lookup table (surely it must be a lookup field, otherwise just the value will be displayed).
DotnetKicks
DotNetShoutout

Tags: , ,

Sharepoint