Click here to Skip to main content
12,635,662 members (27,143 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# checkbox Forms
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 13-Jan-13 22:53pm
Updated 14-Jan-13 7:22am
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
PosiRob 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....
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
PosiRob 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.161208.2 | Last Updated 14 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100