|
-
Jul 9th, 2009, 05:23 AM
#7
Re: datagridview column formatting
There's no such thing as "formatting a column as checkbox". If you want a column of check boxes then you use a DataGridViewCheckBoxColumn, plain and simple. You can't use some other type of column, e.g. a DataGridViewTextBoxColumn, and then somehow change its type to display check boxes. Each different type of column is designed to host a different type of control. If you want check boxes you use a DataGridViewCheckBoxColumn.
The DefaultCellStyle has absolutely nothing to do with this. The control hosted in the cells of a column is nothing to do with format.
There's also no reason for you to have any code for this. You should be adding the column in the designer. If you need to bind it to a column or property in the grid's DataSource then you need to set the column's DataPropertyName.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|