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

HI ALL ! i want to provide rating of items of a sharepoint 2010 list from a grid view hat is showing all the list items in a grid with branding . is there any way to add a rating column in a grid with Social Rating Control (yellow , blue & empty stars)??

please suggest me any workaround about this issue.. thanks in advance!!

share|improve this question

1 way in can think of is using a GridView's OnRowDataBound event. In your grid, include an empty column, with say a Panel in it. Give the panel an ID.

Then using something like this, find the panel in the grid, and using the value of the rating field of the current item being bound, add images:

void YourGrid_RowDataBound(Object sender, GridViewRowEventArgs e)
  if(e.Row.RowType == DataControlRowType.DataRow)
    SPListItem item = (SPListItem)e.Row.DataItem;
    Panel stars = e.Row.Cells[?].FindControl("StarsPanel") as Panel;
    if(stars != null)
      int rating = 0;
      int.TryParse(item["Rating"].Tostring(), out rating);
      for(int i = 0; i < rating)
        //add images
share|improve this answer

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.