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

CellFormatting and Conditional Formatting

1 Answer 204 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 26 May 2017, 04:29 AM

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?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 May 2017, 10:27 AM
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.

Regards,
Dess
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.
Tags
GridView
Asked by
Craig
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or