I am able to unrate other stars by clicking on already rated star now what I need is to unrate the first star by clicking on it again
Thanks,
aRviN
3 Answers, 1 is accepted
0
Niko
Telerik team
answered on 03 Oct 2011, 10:01 AM
Hi Arvin,
You could track the changes in the rating by handling the OnClientRated event. In there you can check if the old value is 1 and the new value is 1 again, then you can force the value to 0. Here is a sample handler method to accomplish this:
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Ok for the client... but If I want use in a server side code ?
I have 3 state and I want use only two star.. 0 and 1 and 2.
When I click on a star I must enter in a function server side.
Is it possible ?
0
Niko
Telerik team
answered on 21 Nov 2011, 12:53 PM
Hello Lupotana,
Even though the solution is on the client-side, it should work just fine with a RadRating control that is set to autopostback, because the client-side event handler will be called just before the page is being sent to the server.
Still if you wish to completely escape the client-side code, then you will need to have a way to persist the old value of the RadRating control on the server side and in the OnRate event handler you need to make the same checks and assignments as in the client-side approach.
Hope this helps.
Greetings,
Niko
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now