CellFormatting and Conditional Formatting

2 posts, 0 answers
  1. Craig
    Craig avatar
    5 posts
    Member since:
    Oct 2010

    Posted 25 May 2017 Link to this post

    I have a GridView control that has a custom CellFormatting event implemented that detects if a row is to be deleted on save, sets the back colour to grey and makes the test italic.

    Following recommended Telerik practice I apply ResetValue format to cells not affected by the above format condition.

    All works great.

    My problem occurs when a user applies a ConditionalFormat, it doesn't display. If I comment out the ResetValue commands, the user defined Conditional Formatting shows as expected.

    Is there a way you can get the Conditional Formatting to be applied after the CellFormatting event, or call for the ConditionalFormatting to be applied from the CellFormatting event?

  2. Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    3568 posts

    Posted 29 May 2017 Link to this post

    Hello Craig, 

    Thank you for writing.  

    The CellFormatting event has a higher priority than the ConditionalFormattingObject. That is why the formatting applied by the ConditionalFormattingObject is not preserved when resetting the style in the CellFormatting event to the default style. The possible solution that I can suggest is to apply the custom style only in the event. Thus, you can combine the two conditions and the correct style will be applied. Additional information for the CellFormatting event is available here: http://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells

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

    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top