Click here to Skip to main content
14,691,021 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to change row background color based on condition like


if(col["age"] > 27)
row.background=color.green
else
row.bcakground=color.yellow

What I have tried:

if(col["age"] > 27)
row.background=color.green
else
row.bcakground=color.yellow
Posted
Updated 10-Oct-17 23:58pm

1 solution

You must set the defaultCellStyle BackColor.

row.DefaultCellStyle.BackColor = Color.Red;
   
Comments
Karthik_Mahalingam 11-Oct-17 5:17am
   
5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900