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

Add background highlight for grid row(s)

4 Answers 533 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 11 Oct 2017, 07:43 AM
Hello,
I need to add the background highlight for grid row(s), please help me to implement it!
Thanks

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 12 Oct 2017, 07:25 AM
Hello, Paul,  

Thank you for writing.  

By default, each theme that comes with the Telerik UI for WinForms suite has hot tracking (highlight) and selected color. In order to customize both colors, you have two options. The first one is to use the CellFormatting event and customize the cells when the row is selected or the mouse is over it. The following help article is quite useful about this event: https://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells

The second approach is to customize the theme in Visual Style Builder. You can change the style for the respective state and the desired element in the grid's elements hierarchy.You can read more details about using the Visual Style Builder here:

1.     Loading predefined themes
2.     
Working with Repository Items
3.     
Saving and Loading Theme Files
4.     
Loading Themes from an External File
5.     
Loading Themes from a Resource
6.     
Applying Theme to a Control
7.     
http://tv.telerik.com/watch/winforms/visualstylebuilder/whats-new-visual-style-builder-q1-2010

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Paul
Top achievements
Rank 1
answered on 13 Oct 2017, 10:07 AM

Hi Dess,

I don't want to change the Hover Color.

I want to always highlight some rows (ex: red color), i still keep the default color and hover color for other rows.

i were tried use CellFormatting, CellPaint however it's not working, it just work when row hover. 

0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Oct 2017, 11:24 AM
Hello, Paul,    

Thank you for writing back. 

The CellFormatting event is the appropriate way to customize the cells. It would be necessary not only the specify the color but also enable drawing the fill color. I would recommend you to have a look at the Cells background formatting section in the following help article: https://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells

If you are still experiencing any further difficulties, it would be greatly appreciated if you can provide a detailed explanation about the exact goal that you are trying to achieve. Thus, we would be able to think about a suitable solution and assist you further. Thank you in advance.

I hope this information helps. If you have any additional questions, please let me know. 

 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Paul
Top achievements
Rank 1
answered on 16 Oct 2017, 02:45 AM

Hi Dess,

Thank you for your help.

This issue has been resolved.

Regard,
Paul

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