how to change a cell back or fore color in datagridview -
01-14-2009
, 05:11 PM
Hi All,
I want to change the cell backcolor or forecolor, my code is the
following:
DataGridView1.datasource = dt 'dt is a data table
DataGridView1.Item(1,1).Style.ForeColor = Color.Red
DataGridView1.Item(1,1).Style.BackColor= Color.Blue
when I run the program, the specified cells do not change their color.
Why?
Thanks for the help! |