Click here to Skip to main content
15,917,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The datagridview row header is coming as parent form. if the background form is black color then datagridview row header is coming as black.

<img src="http://i46.tinypic.com/vvsys.jpg" border="0" alt="Image and video hosting by TinyPic">


below is the link for snapshot
http://i46.tinypic.com/vvsys.jpg[^]

Thanks & Regards,
Ata
Posted
Comments
Christian Amado 29-Aug-12 12:03pm    
RowHeaderStyle setting background color?
Md Athaulla 30-Aug-12 2:22am    
Thanks for the reply. I have changed the background color to dimgray but i guess the actual problem is, datagridview is not getting refreshed. even the datagridview rows are not coming proper.

<img src="http://i50.tinypic.com/29ktndl.jpg" border="0" alt="Image and video hosting by TinyPic">

Please click below link
http://i50.tinypic.com/29ktndl.jpg
Dasaradhi_r 30-Aug-12 6:04am    
1) What do you mean by "datagridview is not getting refreshed"?
2. Just setting the back color will not help. You have to set
EnableHeadersVisualStyles property to false.
Did you try the solution I gave?
Md Athaulla 30-Aug-12 7:02am    
I have Tried the solution you have given but still im facing the same problem. please look at the snapshot for more details.

http://i50.tinypic.com/ejzspf.jpg
Dasaradhi_r 30-Aug-12 7:16am    
How is it looking if you set RowHeadersVisible = false?

1 solution

Quote:
If you don't want to have a row header, set the "RowHeadersVisible" property of datagridview to false as given below:
dataGridView1.RowHeadersVisible = false;

If you want to set a different color to row header, use the code below:
dataGridView1.RowHeadersDefaultCellStyle.BackColor = Color.Red;
dataGridView1.EnableHeadersVisualStyles = false;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900