Click here to Skip to main content
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 22:53pm
PosiRob971
Edited 14-Jan-13 7: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 680
1 Maciej Los 300
2 Suvendu Shekhar Giri 229
3 Sascha Lefévre 229
4 Richard Deeming 195
0 Sergey Alexandrovich Kryukov 9,678
1 OriginalGriff 9,135
2 Peter Leow 5,082
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 2,606


Advertise | Privacy | Mobile
Web01 | 2.8.150327.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