Loop through DataGrid CheckBox

dennisrethinam

New member
Joined
Mar 21, 2005
Messages
1
Programming Experience
Beginner
Hi

I am new to VB.Net. I have a Panel in a Windows form and i have placed a DataGrid into it.
I have two colums in the table and add a dynamic column of type checkbox to the datatable
and bind the datatable with the Grid.

The grid displays with the required column values and the checkboxes correctly.

The Problem is that When a button is clicked i need to loop through the Grid and find out
the checkboxes that are clicked.

***** This is What i have Written ********

Dim ctl As System.Windows.Forms.Control
Dim chk As System.Windows.Forms.CheckBox

For Each ctl In Me.Controls

If TypeOf (ctl) Is CheckBox Then

chk = ctl

If chk.Checked = True Then

MsgBox("Checked")

End If

End If

Next

*************************
Can u please help me with the code..

Thanx in advance.

/regds
Dennis
 
Top Bottom