I see that you are using the 5.21 modeler. You can try the datagrid extension widget. It supports styling rows in a datagrid based on a value.
https://appstore.home.mendix.com/link/app/877/Flock-of-Birds/Data-Grid-Extension-(Flex-Headers)
I see two options. Since the first one with the HTML snippet seems feasible and a bit better maintainable, I would go for the first option. The custom widget would have the benefit that you do not have to create an extra attribute, but you would possibly need extra database calls from the widget, to check which row to highlight.
Extra technical attribute + HTML snippet
Custom widget
Mugilan,
A new widget was just published that does this. Its called Grid Cell Styler and you can find it here: https://appstore.home.mendix.com/link/app/106254/ It would require you to upgrade your app, but might be worth looking into.
Mike