On another spot on the same page, I was using other RadRating controls.
They are dynamically-generated RadRating tools that pull both radrating.Value and radrating.ItemCount's value from a DB column. The database connection is working fine (I am grabbing the correct values). What the code does is loop through a collection of database rows, and gets each row's "Rating" column and then sets Value and ItemCount from that value. It then adds the RadRating tool to a table cell, that cell to a table row, makes a fills a few more cells, adds those to the row, and finally adds that row to a table and begins the loop anew.
There is also a dropdownlist that allows the user to select how to sort the records (which destroys the table and rebuilds it in the new order. After sorting, sometimes the stars stop showing up properly in the rating control. Even though, say, ItemCount and Value are set to 5 for a rating, it will show 5 stars and only have 3 marked.
The RadRating is disabled since it is read-only and the user should not be able to manipulate its value. Here is the inner contents of the for loop that makes the table rows:
//Review is an object representing a SQL database object.
//Review sits in a collection of other database objects from
//the same SQL table. The collection has already been ordered
//according to desired search parameters from the dropdownlist
//Build rating cell
RadRating Rating =
//Some rating information
//Note that ItemCount and Value are set to the same value!
Rating.ItemCount = Review.Rating;
Rating.Value = Review.Rating;
//This never fires, even when ItemCount and Rating are being shown as different
(Review.Rating != Rating.ItemCount)
cell.Text = Review.ReviewText;
//reset rating for next iteration
The problem I've encountered with the ItemCount and/or Value displaying properly is very strange. I have testing code for when the error occurs (Response.Write("DIFFERENT VALUES"), but that never fires.
This problem did reproduce on my machine, but it hasn't since I removed the global <span> affecting custom CSS. Is it possible that that CSS was causing the RadRating tools to display this discrepancy between ItemCount and Value, or should I dig deeper to find what caused the bug?