Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Design as follows in the data grid view;

Date Session VRV CK CNN CKK MS TMS RK MK

8/1/2012 1 coursenmae
8/1/2012 2
8/1/2012 3
8/1/2012 4


in the above i want to give the fore color for Date and Session in the data grid view how to do
Posted

1 solution

Hi Member,

C#
private void CellColorChange()
{
for (int i=0; i <= GViewName.Items.Count -1; i++)
{
GViewName.Items[i].Cells[0].ForeColor  = System.Drawing.Color.FromName("#8BB381");
GViewName.Items[i].Cells[1].ForeColor  = System.Drawing.Color.FromName("#8BB381");
}
}



call this method in your application event.
 
Share this answer
 

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