To contact us Click HERE
Here I am trying to get the new design for my DataGridView header back color. So that, I have been tried a lot in Google and got the solution which is explained below.
Set the following properties for your DataGridView control by using the properties window.
EnableHeadersVisualStyles = False
RowHeadersBorderStyle = Raised
Then copy the following code in your Form_Load event.
DataGridViewCellStyle style = this.dataGridView1.ColumnHeadersDefaultCellStyle;
style.BackColor = Color.WhiteSmoke;
style.ForeColor = Color.Gray;
style.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
Now run your application, the header style would be changed and showing a new style that we wants.
...S.VinothkumaR.
Hiç yorum yok:
Yorum Gönder