Hi All,
I am facing one issue while working with UiPath grid forms. I need to change background color of grid table (Textbox) when the textbox contains specific value
for example: change the background color if textfield in datagrid contains ‘incorrect’ keyword
Note: Currently I’m populating data table results in UiPath Form’s Datagrid dynamically.
Any help/suggestions please
It doenot directly provide to add colors but you can do that go to UiPath Forms Designer select your DataGrid the go to Advanced then go to Custom CSS Class and assign a class name, e.g. my-grid
Then add Custom CSS for conditional formatting
In the Form JSON or via a Custom CSS file, add rules like for light red colour:
.my-grid td {
padding: 5px;
}
.my-grid td:has(input[value*=“incorrect”]) {
background-color: #ffcccc !important;
}
Cheers
Hi Bhavesh,
Thank you for your reply. Could you please explain below point in more detail.
In the Form JSON or via a Custom CSS file
Form json - is it Component Json of datagrid?
How to create custom CSS file?
Thank you in advance!
In the Form JSON or via a Custom CSS file means when you design a Form, UiPath stores the definition as a JSON schema. You can view or edit this schema by opening your Form in UiPath then select the Form panel → Advanced → Edit JSON. This JSON includes each component’s JSON including the DataGrid.
To add custom css you open your Form in UiPath Studio the select the Form Designer activity and in the Properties Panel → Advanced, look for Custom CSS and paste your CSS directly into that box.
.my-grid td input[value*=“incorrect”] {
background-color: #ffcccc;
}
Cheers