I have a visual webpart with a people picker in it which does successfully save people chosen to a SharePoint person or group column on my Entry Form. On my custom Edit Form I just need to read the people back out of the same SharePoint person or group column into the People Picker so they can be edited. I'm attempting this in C#.

1 Answer 1

SPFieldUserValueCollection userValueCollection = new SPFieldUserValueCollection(SPContext.Current.Web, SPContext.Current.Item["Field"] as string);
                        if (userValueCollection.Count > 0)
                            MypeopleEditor.CommaSeparatedAccounts = userValueCollection[0].User.LoginName;

I was able to find a solution. I hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.