Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Show ReadOnly DataGridViewCheckBoxColumn CheckBoxes as Grey'd out.
 

Show ReadOnly DataGridViewCheckBoxColumn CheckBoxes as Grey'd out.

Setting the ReadOnly property to True for a DataGridViewCheckBoxColumn object does not draw the CheckBoxes as Grey'd out.
For the DataGrid, I made a custom CheckBox column where I painted Grey CheckBoxes when the column was in ReadOnly mode.  Do I have to do something similar to this for the DataGridViewCheckBoxColumn class or has some style been provided to do this?
Thanks for any help/suggestions,
Nate
naxtell  Monday, November 07, 2005 3:32 PM
I accomplished this by creating custom DataGridViewCheckBoxColumn and DataGridViewCheckBoxCell classes.  The custom Column class has its CellFormat property set to a new custom Cell class object.  In the custom Cell class I just had to override the Paint method and draw the disabled checkboxes at the correct point.  I refered to Customizing the DataGridView Control, looking at the disabled Button column.
naxtell  Monday, November 14, 2005 12:37 PM

You can use google to search for other answers

Custom Search

More Threads

• DataTreeGridView
• Binding to custom types
• BindingNavigator Control
• changing DataGridViewComboBoxColumn datasource at runtime.
• GridView DeleteCommand Firing Twice
• Host Controls in Windows Forms DataGridView Cells
• why I cann't insert new row between with 2 rows ?
• Updating a Dataset
• edit objects outside of the DataGridView
• dbconcurrency error