Hi Wisej,
DataGridView ForeColor not change at runtime.
How to change ForeColor at runtime?
Thank you.
The DataGridView doesn’t have the ForeColor property, like in WinForms.
You can set the ForeColor like this:
I was able to get the cells’ ForeColor to change in your demo by changing the ForeColor property of DataGridView1.DefaultCellStyle (rather than DataGridView1.RowTemplate.DefaultCellStyle), and then by calling Refresh() on the data grid view to update its appearance.
So in your demo the line
Me.DataGridView1.RowTemplate.DefaultCellStyle.ForeColor = dlg.Color
Gets replaced with
Me.DataGridView1.DefaultCellStyle.ForeColor = dlg.Color 'changes the color
Me.DataGridView1.Refresh() 'update appearance