Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag 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})
ASKER CERTIFIED SOLUTION
Avatar of Ark
Ark
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks
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.
Thanks for the advice