How do I loop through checkboxes and set them as Checked?

P

Paul D. Fox

I have a Datagrid where there is a Checkbox in the Header. When the user
clicks on this checkbox, I want all the checkboxes in each row to show as
Checked. How do I interate through each one and set it to 'Checked' ?

Paul
 
P

Paul D. Fox

I figured it out.... I'm doing it Server-Side.

Dim blnCheckBoxChecked As Boolean = False
btnSubmit.Enabled = False

Dim i As DataGridItem
For Each i In dgTimesheet_Master.Items
Dim deleteChkBxItem As CheckBox =
CType(i.FindControl("chkSelectedCheckBox"), CheckBox)
If deleteChkBxItem.Checked = True Then
blnCheckBoxChecked = True
End If
Next i

btnSubmit.Enabled = blnCheckBoxChecked '(True or False)
 
Y

Yogesh Kadalgikar

So how will it be reflected into the ASP.NET Pages.
I had a similar problem. But the code snippet provided to me did not work.

Regards,
Yogesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top