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

Rating - Rate and Leave a Comment

4 Answers 235 Views
Rating
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 18 May 2014, 02:40 PM
Hi,

i tried out your Rating-Example "Rating - Rate and Leave a Comment" which works great, but how do
i get the Rating Object in the "btnPostComment_Click" Event?

Thanks
Best Regards
Rene

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 May 2014, 04:08 AM
Hi,

Please try the following C# code snippet to access the Object of RadRating in "btnPostComment_Click" event.

C#:
RadRating ratingControl = this.FindControl("RadRating1") as RadRating;

Thanks,
Shinu.
0
ITA
Top achievements
Rank 1
answered on 19 May 2014, 06:19 AM
Hi,

i tried your example, but ratingControl is null!

thanks
Rene
0
ITA
Top achievements
Rank 1
answered on 19 May 2014, 08:11 AM
Hi,

I think I have to explain a little more. I use MasterPpage with ContentPlaceHolder. On my Page I use a RadGrid and a coloumn with a RadRating Control. After rating I open the tooltip and after "btnPostComment_Click" I want get the actual rating to write back in my database.

But I can't access the right Row in RadGrid.

Thanks
Rene
0
Accepted
Shinu
Top achievements
Rank 2
answered on 20 May 2014, 03:19 AM
Hi,

I guess your RadRating is inside the ItemTemplate of RadGrid. Please have a look into the following code snippet to access the ItemTemplate control of RadGrid and also take a look into this help documentation which discuss about Accessing Cells and Rows of RadGrid.

C#:
protected void btnPostComment_Click(object sender, EventArgs e)
{
     foreach (GridDataItem item in RadGrid1.Items)
     {
         RadRating ratingControl = item.FindControl("RadRating1") as RadRating;
     }
}

Let me know if you have any concern.
Thanks,
Shinu.
Tags
Rating
Asked by
ITA
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
ITA
Top achievements
Rank 1
Share this question
or