Style CheckBox in GridViewCheckBoxColumn.

1 Answer 38 Views
GridView
JIJIKO
Top achievements
Rank 1
Iron
JIJIKO asked on 05 Nov 2021, 07:33 AM

Hi(=^_^=),

I have set the Style and EditorStyle of GridViewCheckBoxColumn.

Here it is:

<telerik:GridViewCheckBoxColumn Header="IsChecked1" 
DataMemberBinding="{Binding IsChecked}"
Style="{DynamicResource GridViewColumnStyle}" 
EditorStyle="{DynamicResource CheckBoxStyle}">
</telerik:GridViewCheckBoxColumn>

But the CheckBoxStyle only works when it is being edited.

Like this:

So..Which style can i set to change the normal style of checkbox?

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 09 Nov 2021, 12:37 PM

Hello JIJIKO,

The Style property of GridViewCheckBoxColumn is inherited from the FrameworkContentElement which is a base class of the column. The property is not used in the column. Also, the column creates two different elements when in edit mode and when outside of it. The EditorStyle property is applied only to the element created in the edit mode. There is no property that sets the style of the element created in the no-edit (the read-only) mode.

To achieve your requirement, you can create a column that derives from GridViewCheckBoxColumn and use its CreateCellElement override to apply a custom style. You can find this approach in the attached project. I hope it helps.

Regards,
Martin Ivanov
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/.

Tags
GridView
Asked by
JIJIKO
Top achievements
Rank 1
Iron
Answers by
Martin Ivanov
Telerik team
Share this question
or