Add background highlight for grid row(s)

5 posts, 1 answers
  1. Paul
    Paul avatar
    34 posts
    Member since:
    Apr 2017

    Posted 11 Oct 2017 Link to this post

    Hello,
    I need to add the background highlight for grid row(s), please help me to implement it!
    Thanks
  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 12 Oct 2017 Link to this post

    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.
  3. Paul
    Paul avatar
    34 posts
    Member since:
    Apr 2017

    Posted 13 Oct 2017 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    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. 

  4. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 13 Oct 2017 Link to this post

    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.
  5. Paul
    Paul avatar
    34 posts
    Member since:
    Apr 2017

    Posted 15 Oct 2017 Link to this post

    Hi Dess,

    Thank you for your help.

    This issue has been resolved.

    Regard,
    Paul

Back to Top