This is a migrated thread and some comments may be shown as answers.
GridView: Change back color Checkbox by default in grid
2 Answers 5 Views
This is a migrated thread and some comments may be shown as answers.
Eusebio
Top achievements
Rank 1
Eusebio asked on 06 Nov 2020, 01:18 PM

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 Answers, 1 is accepted

Sort by
0
Nadya
Telerik team
answered on 06 Nov 2020, 03:28 PM

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/.

0
Eusebio
Top achievements
Rank 1
answered on 09 Nov 2020, 09:39 AM
Thanks Nadya....this did work.
Asked by
Eusebio
Top achievements
Rank 1
Answers by
Nadya
Telerik team
Eusebio
Top achievements
Rank 1
Share this question
or