Change row color

9 posts, 0 answers
  1. Johny
    Johny avatar
    9 posts
    Member since:
    Nov 2009

    Posted 31 Jul 2010 Link to this post

    Hi Guys
    I want to change row color based on column value, How can I do this.. I'm using telerik 2008.
  2. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 02 Aug 2010 Link to this post

    Hello Johny,
    (I already answered this here)

    I have no ideea what's changed since then but if you want to format a row, in my personal opinion, you should use the CellFormatting event:
    "
    Telerik Documentation Formatting Cells or RowFormatting event:Telerik Documentation Formatting Rows.

    And an answer from telerik says that:
     "As long as the RadGridView control uses UI virtualization, GridCellElement and GridRowElement should be used only in formatting events. Please refer to this blog post for more information about virtualization and formatting."

    Try them and use whichever suits your needs the best.
    "

    Best Regards,
    Emanuel Varga
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Johny
    Johny avatar
    9 posts
    Member since:
    Nov 2009

    Posted 02 Aug 2010 Link to this post

    Hi Emanuel Varga:

    Thanks for your reply, I don't know why your given link showing HTTP 404 error, however other stuff are helpful to me.
    Could you please post sample code snippets for me.

    Regards
    Johny
  5. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 02 Aug 2010 Link to this post

    Hello again,

    I guess they changed the links for the documentation, anyhow this is for the RowFormatting and for the CellFormatting

    Sorry about that
  6. Johny
    Johny avatar
    9 posts
    Member since:
    Nov 2009

    Posted 02 Aug 2010 Link to this post

    Hey Varga: Thanks a lot...... :)
  7. Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 04 Aug 2010 Link to this post

    Hello Johny,

    Thank you for your question.

    As Emanuel explained, in order to change row color based on cell value you can use the RadGridView formatting events.

    A second option is to use conditional formatting. You can read about this method in this help article.

    All the best,
    Alexander
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 04 Aug 2010 Link to this post

    Hello Alexander,

    Until recently I've been using mostly conditional formatting, but conditional formatting has some problems changing the back Color of the row to reflect the OnHover event.

    Best Regards,
    Emanuel Varga
  9. Johny
    Johny avatar
    9 posts
    Member since:
    Nov 2009

    Posted 04 Aug 2010 Link to this post

    Hi Varga
    Absolutely right! I agree with you...

    Thanks
    Md. Marufuzzaman
  10. Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 06 Aug 2010 Link to this post

    Hello,

    The Conditional formatting defines the local value for the visual properties of the cells. It has higher priority than the styles, defined by the theme. That is why the theme hover style does not affect the cells visual appearance when it is set using conditional formatting.

    Regards,
    Alexander
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready