SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

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'm working on rating feature for our SharePoint application. I have a custom list something like below: ex.

UserId -- Title -- JobId -- Rating(0-5) -- Number of Ratings

UserId & JobId together makes unique key.

Basically, I have to read rating values and create aggregate and display in UI. So, in my application page I need to read these 'Rating' & 'Number of Ratings' field values.

Can any one please suggest how to do this?

share|improve this question
up vote 1 down vote accepted

In order to retrieve the rating for list item use the following method:

public SocialRating GetRating(
    Uri url

exposed by class SocialRatingManager

To construct Uri for the list item the following code could be used:

var itemUrl = new Uri(SPUrlUtility.CombineUrl(web.Url, item.Url));

The following example demonstrates how to retrieve Social Ratings for list item:

private static SocialRating GetListItemSocialRatings(SPWeb web, SPListItem item)
    var context = SPServiceContext.GetContext(web.Site);
    var socialRatingManager = new SocialRatingManager(context);

    var itemUrl = new Uri(SPUrlUtility.CombineUrl(web.Url, item.Url));
    return socialRatingManager.GetRating(itemUrl);
share|improve this answer

Once you have URI of the item, it's easy to read rating for a list item. Check the link below


SocialRatingManager Members

share|improve this answer
This one is good. Could you suggest me how to find/get the uri for items in a custom list. – sandeep talabathula Jan 30 '12 at 19:59

Your Answer


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

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