How to change CheckBox.Checked in VB.NET based on "yes"/"no" column
I have a form with a DataGridView and CheckBox. What I want is when DataGridView index changes it should change CheckBox checked state, or if I press arrow down or up CheckBox should change depending on cell value. Here is my code: Public Sub cellclick() Dim row As DataGridViewRow Dim r As Integer = usergrid.CurrentRow.Index row = Me.usergrid.Rows(r) 'the value of the cell("ACCES1") maybe yes or no If row.Cells("ACCESS1").Value.ToString = "YES" Then CheckBox1.CheckState = CheckState.Checked 'i also try checkbox1.checked=true ElseIf row.Cells("ACCESS1").Value.ToString = "NO" Then CheckBox1.Chec
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.