Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create a custom DataGridViewCheckBoxColumn. First I created a custom CheckBox, and it works fine.
The checkbox has two appearances based on public boolean value "Adjustable" that I created. If Adjustable = false (default) the onpaint event won't be overridden, if it is true the onpaint event creates the custom appearance.

I now want to create a CheckBoxColumn in my DataGridView based on this checkbox.
I tried to create the type DataGridViewCheckBoxColumnCustom, this works fine, but I can't find how to set it to use my custom Checkbox.

I tried to create a celltemplate based on DataGridViewCheckBoxCell but I can't set my custom checkbox, and neither can I find an onpaint event.

So how do I create a custom DataGridViewCheckBoxColumn ?

Rob
Posted
Updated 14-Jan-13 6:22am
v2

 
Share this answer
 
Comments
RobScripta 15-Jan-13 3:37am    
Thanks, the first link you provided answered my question. If you know the answer it is simple, I was searching for an onpaint event to override, but the celltemplate has a paint event that I can override....
Check my answer for this
How can i add custom property to column of custom dataGridview?[^] you can follow the same procedure to solve your problem.
 
Share this answer
 
Comments
RobScripta 15-Jan-13 3:26am    
Thank you for the pointer, but I allready tried in this direction. However I can't find an onpaint method to override.

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