Howto: DataGridView VB.NET 2005 - How can I set cell type to checkbox programmatically?

S

Sam Malone

Can anyone show me (sample code???) how to programmatically set a column
type to "CheckBox" in code (as opposed to the designer)? The datagridview
isn't bound to a design-time dataset so until it executes there are no
columns for which I can select a column type.
 
S

Sam Malone

Eureka, I've got it!!
I was trying to "change" a textbox type to a checkbox after the
"AutoGenerate" had created it. Turns out I have to turn off AutoGenerate and
create it as a CheckBox type in the first place. It's drudgery but it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top