Hello, Shanti,
To customize appearance in
GridViewRatingColumn in
RadGridView you should subscribe to the
CellFormatting event which fires when the content of a data cell needs to be formatted for display. If you would like to customize the element within the cell you should access the
RadRatingElement. Please refer to the following example:
public
partial
class
Form1 : RadForm
{
public
Form1()
{
InitializeComponent();
GridViewRatingColumn column =
new
GridViewRatingColumn(
"Rating Column"
);
radGridView1.Columns.Add(column);
radGridView1.Rows.Add(20);
radGridView1.Rows.Add(35);
radGridView1.Rows.Add(70);
radGridView1.Rows.Add(30);
radGridView1.Rows.Add(18);
radGridView1.CellFormatting += RadGridView1_CellFormatting;
}
private
void
RadGridView1_CellFormatting(
object
sender, CellFormattingEventArgs e)
{
GridRatingCellElement cell = e.CellElement
as
GridRatingCellElement;
if
(cell!=
null
)
{
RatingStarVisualElement firstStar = cell.RatingElement.Items[0]
as
RatingStarVisualElement;
firstStar.ValueElement.Fill.BackColor = Color.Red;
firstStar.ValueElement.Fill.GradientStyle = GradientStyles.Solid;
firstStar.HoverElement.Fill.BackColor = Color.Yellow;
firstStar.HoverElement.Fill.GradientStyle = GradientStyles.Solid;
}
e.CellElement.BackColor = Color.Pink;
e.CellElement.GridViewElement.GradientStyle = GradientStyles.Solid;
}
}
Additional information is available here:
https://docs.telerik.com/devtools/winforms/controls/track-and-status-controls/rating/customization.
I hope this helps. Should you have any other questions, I will be glad to help.
Regards,
Nadya
Progress Telerik
Get
quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.
Learn More.