Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i make datagridview background as transparent.
Background of my form is an image.
i am getting an error that invalid property.
Posted
Updated 10-Oct-11 8:16am
v4

As far as I could find there is not standard way to do this, you will need to subclass the DataGridView and take care of the painting yourself.
You also need to set the background colour of all columns to transparent.

See this SO answer: Set datagrid view background to transparent[^].
As the answer mentions it is indented for an image background, but can be changed to use the parent background colour.

Good luck.
 
Share this answer
 
Comments
theanil 10-Oct-11 14:16pm    
In my project i have an background image..
what shall i do for that..
André Kraak 10-Oct-11 14:22pm    
Then the answer given in the link at supplied (http://stackoverflow.com/questions/1330220/set-datagrid-view-beckground-to-transparent/2462381#2462381) should solve your problem.
So subclass the DataGridView and use the code in the link.
theanil 10-Oct-11 14:25pm    
I tried it but its not working.
André Kraak 10-Oct-11 14:37pm    
Did you make sure that the DataGridView uses the subclass.
http://www.thescarms.com/dotnet/DeriveGrid.aspx
Try following
GridView1.BackColor = Color.Transparent

Hope this should help.
 
Share this answer
 
Comments
theanil 9-Oct-11 14:54pm    
Thanks,
I have already tried it its not working.

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