Winforms RadGrid Right Cell Border

2 Answers 190 Views
GridView
Jacek
Top achievements
Rank 2
Iron
Iron
Iron
Jacek asked on 29 Apr 2022, 10:29 AM

Hello.
In Winforms RadgridView, I'm trying to draw a border on the right side of the cell.
If I set RadGrid theme to "VisualStudio2022Light", the frame is not displayed. Other themes (not all) work good.

    Private Sub RadGridView1_CellFormatting(sender As Object, e As CellFormattingEventArgs) Handles RadGridView1.CellFormatting
        If e.CellElement.IsSelected Then
            e.CellElement.DrawBorder = True
            e.CellElement.BorderBoxStyle = Telerik.WinControls.BorderBoxStyle.FourBorders
            e.CellElement.BorderRightWidth = 1
            e.CellElement.BorderRightColor = Color.Red
        Else
            e.CellElement.ResetValue(LightVisualElement.DrawBorderProperty, ValueResetFlags.Local)
            e.CellElement.ResetValue(LightVisualElement.BorderBoxStyleProperty, ValueResetFlags.Local)
            e.CellElement.ResetValue(LightVisualElement.BorderRightWidthProperty, ValueResetFlags.Local)
            e.CellElement.ResetValue(LightVisualElement.BorderRightColorProperty, ValueResetFlags.Local)
        End If

How can I solve the problem without using VSB.

Regards

Jack

2 Answers, 1 is accepted

Sort by
0
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 02 May 2022, 07:18 AM

Hello Jacek,

Thank you for the provided code snippet.

I have tested your approach but wasn't able to reproduce this. When I set the theme to VisualStudio2022Light, a red border on the right side will appear when a cell is selected. May I ask you to share if you have a custom cell? Can you share an image of your RadGridView when a cell is selected and VisualStudio2022Light is set?

Regards,
Dinko
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
Jacek
Top achievements
Rank 2
Iron
Iron
Iron
answered on 04 May 2022, 01:57 PM

Hello Dinko,

Thank you for your answer and sorry for taking your time

It was my mistake when formatting cells

 

Regards

Jack

Tags
GridView
Asked by
Jacek
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dinko | Tech Support Engineer
Telerik team
Jacek
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or