# Runtime Interaction

## Content



In addition to creating and managing conditional formatting rules through code, **Rules Manager** enables performing all these actions at runtime using the control's UI. It supports the use of built-in conditions or the creation of custom expressions using the expression parser and formula editor at runtime.

### Add a Rule at Runtime

Click the **Add Rule** button to add rule during runtime.

![](https://cdn.mescius.io/document-site-files/images/ac639fbf-046b-4a70-872a-c6393c366bf1/images/add-rule-runtime.png)

Rules can be stylized using a style picker. However, style picker is only used inside expression and segments rules and allows changing the different properties of a **RuleEngineStyle**.

![](https://cdn.mescius.io/document-site-files/images/ac639fbf-046b-4a70-872a-c6393c366bf1/images/style-editor.gif)

### Delete a rule at Runtime

*   Click on the Ellipsis (...) beside the rule to extend menu.
*   Click the delete button (x)

![](https://cdn.mescius.io/document-site-files/images/ac639fbf-046b-4a70-872a-c6393c366bf1/images/delete-rule-runtime.png)

### Apply Conditional Formatting

For FlexGrid, ConditionalFormattingBehavior is a built-in adapter so anyone can easily display the rules inside C1FlexGrid.

Click on the ellipsis (...) beside the column header to open the drop-down menu.

![](https://cdn.mescius.io/document-site-files/images/ac639fbf-046b-4a70-872a-c6393c366bf1/images/flexgrid-conditional-formatting.gif)

The following actions can be performed through the drop-down menu:

*   Choose the preferred type of format for Color Scale rule and Data bar rule
*   Click on New Rule to create a new rule and click apply
*   Click on Manage Rule from the drop-down menu to add, edit and delete any rule
*   Click Icon Sets to add any icons to the data.

Note: These menus can be disabled by setting **ShowInColumnHeaderMenu=false**