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

Update RadRating in Footer

2 Answers 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bryan Kowalchuk
Top achievements
Rank 1
Bryan Kowalchuk asked on 23 Nov 2010, 10:42 PM
I add a RadRating control to a RadGrid footer at runtime. I can retrieve a updated value from the server using AJAX and would like to update this value with the latest server value. I have an event that can be called on the client side. My problem is how can I find the RadRating using Javascript at runtime? Below is a sample of the code I use to insert the control during the RadGrid1_ItemCreated event.

if (e.Item is GridFooterItem)
{
    GridFooterItem footerItem = (GridFooterItem)e.Item;
    TableCell tc = new TableCell();
                
    footerItem.Cells[5].Text = "<b>Overall Rating:</b>";
    footerItem.Cells[5].HorizontalAlign = HorizontalAlign.Right;
    //Add group rating summary
    RadRating radrateemp = new RadRating();
    RadRating radratesuper = new RadRating();
    radrateemp.ReadOnly = true;
    radrateemp.ID = "EmpRatingOverall";
    radratesuper.ReadOnly = true;
    radratesuper.ID = "SuperRatingOverall";
    footerItem.Cells[7].Controls.Add(radrateemp);
    footerItem.Cells[6].Controls.Add(radratesuper);
}

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 25 Nov 2010, 11:00 PM
Hello Bryan,

You could find the desired control using the findControl method that is available in our static client-side library:
Telerik static client library
var radRating1 = $telerik.findControl(document, "EmpRatingOverall");
 
//or
 
 
var radGridElement = $get('<%= RadGrid1.ClientID %>');
var radRating = $telerik.findControl(radGridElement, "SuperRatingOverall");


Regards,
Daniel
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Bryan Kowalchuk
Top achievements
Rank 1
answered on 26 Nov 2010, 10:47 PM
Worked great, thanks.
Tags
Grid
Asked by
Bryan Kowalchuk
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Bryan Kowalchuk
Top achievements
Rank 1
Share this question
or