GridViewRatingColumn

4 posts, 0 answers
  1. Shanti v Shaji
    Shanti v Shaji avatar
    13 posts
    Member since:
    Jun 2016

    Posted 30 Jul Link to this post

    How to customize appearance of the GridViewRatingColumn in radgidview 
  2. Nadya
    Admin
    Nadya avatar
    42 posts

    Posted 31 Jul Link to this post

    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.
  3. Shanti v Shaji
    Shanti v Shaji avatar
    13 posts
    Member since:
    Jun 2016

    Posted 01 Aug in reply to Nadya Link to this post

    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.

     

     


  4. Nadya
    Admin
    Nadya avatar
    42 posts

    Posted 01 Aug Link to this post

    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
    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.
Back to Top