Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Rating > Help radRating in Repeater control

Not answered Help radRating in Repeater control

Feed from this thread
  • Robert avatar

    Posted on Nov 11, 2011 (permalink)

    I am using your 'rating & comment' example as the starting blocks for a ratings system I am building but I have hit a snag when using inside a repeater.

    Line 13:        function OnClientRated(controlRating, args) {
    Line 14:             var tooltip = $find("<%= RadToolTip1.ClientID %>");
    Line 15:             tooltip.show();
    Line 16:         }

    My browser is telling me it cant find 'RadToolTip1' as it is within a repeater. How do I fix this? What do I need to change on the JS so it can see the radtooltip?

    Also, how do I get the values of the RadRating control (RadRating1) from within a repeater? Can I use OnItemCommand and pass in arguments and commnds???

    Many thanks
    Simon

    Reply

  • Slav Slav admin's avatar

    Posted on Nov 15, 2011 (permalink)

    Hi Simon,

    Note that when an ASP control is located inside a Repeater, accessing it isn't as straightforward as in a default scenario. If you want to reference the client object of the RadToolTip control, you will have to utilize additional client script in order to successfully find the control. Please find attached a sample page, implementing a possible solution for the scenario at hand.

    As for accessing the RadRating's value, you can handle the server event ItemDataBound and find the control in the Repeater's Item, as shown below:
    protected void myRepeaterUL_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        var rating = (RadRating)e.Item.FindControl("RadRating1");
    }

    I hope that helps. Please let us know if you encounter additional difficulties.

    Regards,
    Slav
    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Rating > Help radRating in Repeater control
Related resources for "Help radRating in Repeater control"

ASP.NET Rating Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]