Avatar of Murray Brown
Murray Brown
Flag for United Kingdom of Great Britain and Northern Ireland asked on

VB.net Adding a row to a DataGridView that has a checkbox column

Hi

  What VB.net code do I use to add a row of data to a DataGridView where the last column is a checkbox column.
 I have tried the following to approaches which both don't work

  DataGridView1.Rows.Add(New String() {oColumnName, "", ""})
DataGridView1.Rows.Add(New String() {oColumnName, "", False})
* DataGridViewVisual Basic.NET

Avatar of undefined
Last Comment
Murray Brown

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ark

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Scott McDaniel (EE MVE )

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Murray Brown

ASKER
Thanks
Ark

Glad I could help. One more comment though: databound controls are UI representation of data. In most cases they are intended to view data and to edit data inside them (using keyboard/mouse). If you want change smth in code without user action it's better to change data rather then control properties. I.e. if your datagridview bounded to datatable (either via bindingsource or directly) - it's better to add row to datatable and gridview will display changes.
Murray Brown

ASKER
Thanks for the advice
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23