Cell Select/focus color change on RadGridView

2 Answers 429 Views
GridView
Giri
Top achievements
Rank 1
Iron
Giri asked on 01 Sep 2022, 02:08 PM
Hello Team,
  we are using the Radgrid in our application. we need to change the cell select/focus color change on gridview.  
  
  Actual required
      
I need to change the blue color with dark blue border in cell selected highlighter on the grid focus and I need to change the yellow color in grid focus out. we have added the screenshot for your reference. Please help us. 
 
Screenshot : https://prnt.sc/X529hq6pL0Uz

2 Answers, 1 is accepted

Sort by
0
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 01 Sep 2022, 08:21 PM

Hello Giri.

I'm not going to click on any link that i'm not familiar with so i don't see the image you are referring to.  However - here's a little something that might help you resolve this:

Private Sub gridNameHere_CellFormatting(sender As Object, e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles gridClaimDetails.CellFormatting

If e.CellElement.IsSelected Then
e.CellElement.BackColor = whatever background color your want

e.CellElement.BorderColor = whatever border color you want

Else

e.CellElement.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.Local)

End If

End Sub

Might be you want to be testing the IsFocused property of the CellElement instead of IsSelected but the principle is the same.

 

Good luck!

-Curtis

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Sep 2022, 04:41 AM

Hi, Giri,

Indeed, as Curtis already suggested, the CellFormatting event that RadGridView offers is a suitable way to customize the styles in the grid cells. Please refer to the following help article which demonstrates how to use the event:

https://docs.telerik.com/devtools/winforms/controls/gridview/cells/formatting-cells 

Please give this approach a try and see how it will work for your project.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Tags
GridView
Asked by
Giri
Top achievements
Rank 1
Iron
Answers by
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or