Question

I'm working on a RadGrid that has all its columns and databinding done at runtime. One of the columns in the grid is a GridRatingColumn. It works, but I'd like to be able to differentiate between items with a value of 0 and items with no value (Null). Currently, the GridRatingColumn shows a rating of 0 for Null values.

Is there a way to have a GridRatingColumn be empty (no stars) with a Null value and display blank stars with a value of 0?

Code:

Dim colScore As GridRatingColumn = New GridRatingColumn
_grid.MasterTableView.Columns.Add(colScore)
colScore.DataField = "score"
colScore.HeaderText = "Score"
colScore.UniqueName = "colScore"
colScore.ItemCount = 5
colScore.Precision = RatingPrecision.Half
Was it helpful?

Solution

You can try to hide controls corresponding to null ratings in your grid's RowDataBound event.

According to Telerik documentation (more details can be found here here) you can manually retrieve the control like this:

The ID of the rating control in each column cell is Rating_[ColumnUniqueName], where [ColumnUniqueName] is the UniqueName of the GridRatingColumn instance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top