Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > How do I loop through checkboxes and set them as Checked?

Reply
Thread Tools

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

 
 
Paul D. Fox
Guest
Posts: n/a
 
      05-09-2005
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


 
Reply With Quote
 
 
 
 
Paul D. Fox
Guest
Posts: n/a
 
      05-09-2005
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)



"Eliyahu Goldin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Client side or server side?
>
> Eliyahu
>
> "Paul D. Fox" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>>
>>

>
>



 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      05-09-2005
Client side or server side?

Eliyahu

"Paul D. Fox" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Yogesh Kadalgikar
Guest
Posts: n/a
 
      06-08-2005
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

"Paul D. Fox" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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)
>
>
>
> "Eliyahu Goldin" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Client side or server side?
> >
> > Eliyahu
> >
> > "Paul D. Fox" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> 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
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Triple nested loop python (While loop insde of for loop inside ofwhile loop) Isaac Won Python 9 03-04-2013 10:08 AM
How do I loop through TextBoxes and clear them? Paul D. Fox ASP .Net 6 05-22-2005 03:24 AM
convert html to web controls so I can loop through them on the code behind.. Hazzard ASP .Net Web Controls 3 04-26-2004 03:02 AM
Need to loop through checkboxes Greg Griffiths Javascript 1 08-27-2003 06:44 PM



Advertisments