Hi Rushikesh,
are you using datagrid or datagrid2?
I would use something like this in the dynamic classes section:
if ${your value} div 2 = round(${your value} div 2)
then ‘Place class for even’
else ‘Place class for odd’
If you use datagrid you can try and see if this widget still works: Grid cell styler
In datagrid2 you can style the cell by using the custom format.
Like this example (image is from the marketplace module), on the right you can see that you have the option to define styling and conditional visibility