> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codenullapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Client Rules

> In the condition to access the data item data, you need to use the dataItem keyword in the path, for instance, if we want to access the titulo property you can 

## Condition

In the condition to access the data item data, you need to use the `dataItem` keyword in the path, for instance, if we want to access the titulo property you can use `dataItem.Path`

<figure>
  <img src="https://mintcdn.com/codenull/9RtgKoAtzvpYtN-c/images/JV929Sy9ZJgm0gIZRX3R.png?fit=max&auto=format&n=9RtgKoAtzvpYtN-c&q=85&s=0f6b80974fc7eebacadf11d9514fe907" alt="" width="1440" height="624" data-path="images/JV929Sy9ZJgm0gIZRX3R.png" />

  <figcaption />
</figure>

## Result types

### Hide columns in Datagrid

If you want to hide a column in a Datagrid go to add a new client rule and select the type HideColumn and add the Ids (code of the column) you want to hide

<img src="https://mintcdn.com/codenull/fUND-Qmj85v5Oam-/images/oToDRVkTpy4vrEnUm1n4.png?fit=max&auto=format&n=fUND-Qmj85v5Oam-&q=85&s=edee78af8dd62857be16a11280c0be18" alt="" width="633" height="230" data-path="images/oToDRVkTpy4vrEnUm1n4.png" />

### Background row color and Cell Color

Add the possibility to set a background color to the row or cell color depending on specific business logic, using client rules.

Go to the designer, edit the Datagrid and go to the client Rules section

* <img src="https://mintcdn.com/codenull/9RtgKoAtzvpYtN-c/images/ZcGvfg7LDXdufqi7d5GV.png?fit=max&auto=format&n=9RtgKoAtzvpYtN-c&q=85&s=dd1a275c0a39cd751f89ce7f93c95e40" alt="" width="672" height="902" data-path="images/ZcGvfg7LDXdufqi7d5GV.png" />
* Add new client rules as always, click on \*Add new rule
* Fill up all the fields as normal client rule, but in the Result Type you will find two new fields:
  * **setCellBackgroundColor** (Color of the cell)
    1. *Color*: This is the hexadecimal of the color you want to use (e.g. #34913E)
    2. *Column Id or Code*: you can put the specific Column you want to set the color by ColumnId or Code. (it is not required, you can handle it via logic with the client Rule, it is just in case it is needed)
  * **setRowBackgroundColor** (Color of the row)
    1. *Color*: This is the hexadecimal of the color you want to use (e.g. #34913E)
