This is a migrated thread and some comments may be shown as answers.

GridView: Change back color Checkbox by default in grid

2 Answers 389 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eusebio
Top achievements
Rank 1
Veteran
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 | Tech Support Engineer
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
Veteran
answered on 09 Nov 2020, 09:39 AM
Thanks Nadya....this did work.
Tags
GridView
Asked by
Eusebio
Top achievements
Rank 1
Veteran
Answers by
Nadya | Tech Support Engineer
Telerik team
Eusebio
Top achievements
Rank 1
Veteran
Share this question
or