Reading values from a column of type Person or Group in MOSS 2007
Suppose you have a custom list or document library with a column named
‘Members’ of type Person or Group with multiple selections then, the
SPFieldUserValueCollection can be used to hold the multiple values.
The following code snippet will give you an idea on accessing
values from a column of type Person or Group.
SPFieldUserValueCollection selectedMembers = (SPFieldUserValueCollection) _SpListItemRecord[“Members”];
if (selectedMembers != null)
string selected= string.Empty;
foreach (SPFieldUserValue fuv in selectedMembers)
SPUser userA = web.AllUsers[fuv.LookupValue];
selected += userA.Name + “,”;
No comments yet.