How does c# change the font color in datagridview

These two methods are slightly different in the foreground and background:

1, foreground method

Just set the forecolor to the desired color, in this case red.

& ltdatagridview? ForeColor= "red"? /& gt; 2. Background method

You need to name datagridview first. Just set the forecolor to the desired color, in this case red.

datagridview? datagridview 1=new? datagridview();

dataGridView 1。 Foreground? =? Color. Red;