Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i know how to assign a value to a particular cell of datagridview
C#
dataGridView1.Rows[0].Cells[0].Value = 5;


but i want to fill that cell with a colour, how can i do this?
Posted

1 solution

Cell Style
DataGridViewCell.Style Property
C#
dataGridView1.Rows[0].Cells[0].Style.BackColor = Color.White;
 
Share this answer
 
v2
Comments
thatraja 12-Nov-11 12:40pm    
5!
uspatel 12-Nov-11 12:49pm    
thanks...
Sweety Khan 12-Nov-11 13:28pm    
thank u so much :)
Sergey Alexandrovich Kryukov 12-Nov-11 20:31pm    
Simple enough, isn't it? My 5.
--SA

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