Click here to Skip to main content
Sign Up to vote bad
good
See more: C#checkboxForms
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
PosiRob852
Edited 14-Jan-13 6:22am


2 solutions

  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....
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
Your Filters
Interested
Ignored
     
0 Prasad_Kulkarni 407
1 Christian Graus 363
2 Sergey Alexandrovich Kryukov 325
3 _Amy 288
4 OriginalGriff 285
0 Sergey Alexandrovich Kryukov 6,649
1 Prasad_Kulkarni 3,281
2 _Amy 3,065
3 OriginalGriff 2,989
4 CPallini 2,696


Advertise | Privacy | Mobile
Web03 | 2.6.130617.1 | Last Updated 14 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid