GridView: Change back color Checkbox by default in grid

3 posts, 0 answers
  1. Eusebio
    Eusebio avatar
    53 posts
    Member since:
    Aug 2020

    Posted 06 Nov 2020 Link to this post

    Hi,

     

    The default color of the checkbox in the grid is beige or grey. How do I change the color of the background to white?

    I use: Office2013light

    Attached image.


  2. Nadya
    Admin
    Nadya avatar
    481 posts

    Posted 06 Nov 2020 Link to this post

    Hello, Eusebio,

    In order to change the fill color of the checkmark that is displayed in GridCheckBoxCellElement you should use the CellFormatting event:

     private void RadGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
     {
        var cell= e.CellElement as GridCheckBoxCellElement;
         if (cell != null)
         {
             RadCheckBoxEditorElement editor = (cell.Editor as RadCheckBoxEditor).EditorElement as RadCheckBoxEditorElement;
             RadCheckmark checkmark = editor.Children[0] as RadCheckmark;
             checkmark.Fill.BackColor = Color.White;
         }
     }
    
    

    I hope this helps. Should you have any other questions do not hesitate to contact me.

    Regards,
    Nadya
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  3. Eusebio
    Eusebio avatar
    53 posts
    Member since:
    Aug 2020

    Posted 09 Nov 2020 in reply to Nadya Link to this post

    Thanks Nadya....this did work.
Back to Top