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

GridViewCheckBoxColumn changed CheckBox image

1 Answer 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Xoma
Top achievements
Rank 1
Xoma asked on 09 Feb 2011, 07:19 PM
Hi I am trying to change the default "check mark" to a custom image. However, I am unable to get a hold of radCheckBox instance.

1 Answer, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 09 Feb 2011, 10:08 PM
Hello Xoma,

the most efficient way to do this would be to create your own theme I believe using the Visua Style Builder
You can also change some of the checkmark properties using the CellFormatting event.
For exmaple, this will change the checkmark to a Vista look and feel and the colour of the checkmark to blue

Private Sub MasterTemplate_CellFormatting(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles RadGridView1.CellFormatting
    If TypeOf e.CellElement Is GridCheckBoxCellElement Then
        Dim checkElement As GridCheckBoxCellElement = CType(e.CellElement, GridCheckBoxCellElement)
        Dim checkEditorElement As RadCheckBoxEditorElement = CType(checkElement.GetEditorElement(checkElement.Editor), RadCheckBoxEditorElement)
        checkEditorElement.Checkmark.CheckElement.ForeColor = Color.Blue
        checkEditorElement.Checkmark.CheckElement.CheckPrimitiveStyle = Enumerations.CheckPrimitiveStyleEnum.Vista 'Enumerations.CheckPrimitiveStyleEnum.XP is Default
    End If
End Sub

Another way is just to change the theme of the application or the radgridview itself to another of the built in themes
Hope that helps
Richard
Tags
GridView
Asked by
Xoma
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Share this question
or