amir amir - 1 month ago 8
C# Question

how to Use BMP image file for background of winform in c#

I have winform and i use image.BMP for background of my form and when i run it This happened :

enter image description here

It is working but my problem is background of datagridview
I don't want to see the behind the datagridview
How can i run that form with showing datagridview normally?

mww mww
Answer

You need to use loop and change color of each cell. Do it after set datasource.

foreach (DataGridViewRow row in yourDataGridView.Rows) 
    {
         row.DefaultCellStyle.BackColor = Color.White; 
    }