Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27072

VS 2008 get checked state of checkbox

$
0
0
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!!!

Viewing all articles
Browse latest Browse all 27072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>