This is a migrated thread and some comments may be shown as answers.

RadRating inside Grid Not More than 3 to be selected

1 Answer 41 Views
Rating
This is a migrated thread and some comments may be shown as answers.
Arun
Top achievements
Rank 1
Arun asked on 28 Sep 2011, 07:55 PM
Hello Telerik,

I have RadRating inside my grid,my item count is 1.i need a condition like only out of the say 10 fields that are showing only 3 needs to be set as rated,if the 4th one is rated,then it sholud show a message "you cant select more than 3".

Thanks,
aRviN.!!

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Sep 2011, 08:41 AM
Hello Arvin,

You could attach the OnClientRating event and there you can check for the selected value and cancel the event accordingly.

aspx:
<telerik:GridTemplateColumn HeaderText="Average Vehicle Rating">
     <ItemTemplate>
         <telerik:RadRating ID="RadRating1" runat="server" AutoPostBack="true" OnClientRating="OnClientRating"  />
     </ItemTemplate>
</telerik:GridTemplateColumn>

Javascript:
function OnClientRating(sender, args)
       {
           if (args.get_newValue() > 3)
        {
            alert("you cant select more than 3!!");
            args.set_cancel(true);
        }
    }

Thanks,
Shinu.
Tags
Rating
Asked by
Arun
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or