3 Answers, 1 is accepted
0
Accepted
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:
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
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.
0
Shanti 😎
Top achievements
Rank 2
Veteran
answered on 01 Aug 2019, 10:39 AM
hellooo Nadya....
Thank you so much.
This code is working fine.
I searched a lot for finding a solution for this . finally i got .
Thank you Again.
0
Hello, Shanti,
I am glad that this works for you. Do not hesitate to contact us if you have other questions.
Regards,
Nadya
Progress Telerik
I am glad that this works for you. Do not hesitate to contact us if you have other questions.
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.