SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the following code to output username + presence information in a spgridview.

SPFieldUser field = document.Fields["CustomFieldName"] as SPFieldUser;
if (field != null) {
                                    person= field.GetFieldValueAsHtml(document["CustomFieldName"]);

                                    //SPFieldUserValue userFieldValue = field.GetFieldValue(document["CustomFieldName"].ToString()) as SPFieldUserValue;
                                    //string loginName = userFieldValue.User.LoginName;
                                    //string name = userFieldValue.User.Name;
                                    //string eMail = userFieldValue.User.Email;                                        

I then output the string value person in my grid. This works fine. The icon for presence however is displayed on the right of the persons name. Everywhere else in SharePoint the presence is displayed on the left.

How can I change the format so that it is {Presence Icon} {Persons Name}


share|improve this question
I'm not sure what you have done, so I'll just link to a blog with code that I have used before, maybe it will help you on the way.… – Anders Aune Nov 21 '11 at 6:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.