Archive

Posts Tagged ‘custom SocialData rating’

Adding SharePoint 2010 rating control on your custom forms

February 5th, 2010

Here is an interesting question from a reader: I’m wondering, is there a way to use SharePoint rating control on a form (custom aspx page, which is in _layouts folder) in SharePoint 2010? If so, what’s the syntax? I found there is a control called RatingScaleField, not sure how to use it.

The answer is: maybe but it would require a lot of engineering around the rating control. Rating control is contextual to the item and it pulls/sends information about users rating to/from the SocialDatabase in SharePoint. If you want to use out of the box rating control on a separate page – it will have to have the context of an item you’re referring to.

One other approach to place out of the box rating control on a custom page is to create a new instance of Display/Edit form rendering template. Meaning that you can arrange your fields in any order you want or add new markup or new fields or ASPX controls to the page. Check out this article to get a general idea how to create your own rendering templates.

Once you have an idea about rendering templates, all of you need to do is to reference your rating field as a CompositeField on a rendering template, like this:

<SharePoint:CompositeField ID=”MyRatingFieldId” runat=’server’ FieldName=’Rating_x0020__x0028_0_x002d_5_x0′ />

This will generate a rating scale field on your form wherever you place it. All the wiring is going to be done as well so SharePoint will know where to send your rating etc.

If you want to know how one of my collegues create his own rating control that utilizes SharePoint 2010 SocialData back end – check out both parts of this article.

Good luck!

sharepoint, sharepoint 2010 , , , ,