Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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}

thx

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. blogs.msdn.com/b/uksharepoint/archive/2010/05/07/… –  Anders Aune Nov 21 '11 at 6:35
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.