Hi,
I have a data grid view which is bound to an access table in a VB.net form. I added a column of check boxes to this grid view. I want to delete the checked row from both the table as well as grid view when I am however not able to get the checked state of the checkboxes. i have tried the following codes:
"Dim chk As DataGridViewCheckBoxCell = DirectCast(gvr.Cells("chksel1"), DataGridViewCheckBoxCell)
'If chk IsNot Nothing And chk.Selected = True Then
etc etc"
but this is always deleting the first record from the gridview.
If I use "If gvr.Cells("chksel1").Selected = True Then etc", where "chksel1" is the design name of the check box column and gvr is the name for the datagrid row, then it returns nothing.
Please can someone help!!!
I have a data grid view which is bound to an access table in a VB.net form. I added a column of check boxes to this grid view. I want to delete the checked row from both the table as well as grid view when I am however not able to get the checked state of the checkboxes. i have tried the following codes:
"Dim chk As DataGridViewCheckBoxCell = DirectCast(gvr.Cells("chksel1"), DataGridViewCheckBoxCell)
'If chk IsNot Nothing And chk.Selected = True Then
etc etc"
but this is always deleting the first record from the gridview.
If I use "If gvr.Cells("chksel1").Selected = True Then etc", where "chksel1" is the design name of the check box column and gvr is the name for the datagrid row, then it returns nothing.
Please can someone help!!!