Need to Color form Grid in AX 2012

Hi All,

I want to color form grid on the basis of certain conditions. I written code on displayoption() of datasource. 

Problem: other fields which are on form but not in grid that also coloring. i just want to color grid row. 

is there any other way except color each grid field by control id. I dont want it because there are too many fields and too many conditions.

Any help would be appreciated. please suggest.