Click here to Skip to main content
11,644,136 members (73,481 online)
Rate this: bad
good
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 21:53pm
PosiRob992
Edited 14-Jan-13 6:22am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
PosiRob at 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 at 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
0 OriginalGriff 610
1 jyo.net 484
2 DamithSL 318
3 Afzaal Ahmad Zeeshan 308
4 Sergey Alexandrovich Kryukov 246
0 OriginalGriff 795
1 DamithSL 611
2 Mika Wendelius 494
3 jyo.net 484
4 Afzaal Ahmad Zeeshan 404


Advertise | Privacy | Mobile
Web04 | 2.8.150731.1 | Last Updated 14 Jan 2013
Copyright © CodeProject, 1999-2015
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