CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> .NET

 Looping through Grid checkboxes to see if checked?

Print topic Send  topic

Author Message

Posts: 60
Posted: 12/13/2004, 12:28 PM

I need to write a loop that will go through the column of a grid, which contains Checkboxes, and see if they are checked or not.

I can do this easily in codecharge with a ListBox, and loop through to find if the values are selected, but I'm stumped on how to do this with a Grid and checkboxes.

View profile  Send private message

Posts: 509
Posted: 12/14/2004, 12:01 AM

Not going into details.

When using an event that fires for every line of the grid you use simply the controls name to access it's properties like value.

There are situations (intended use, bugs whatever) where controls do return a value.
But they should in any case be posted. Here you should know that the name of the controls (like checkboxes) has _1, _2 aso append to their original name.
So having the number of rows in the grid you can walk through your checkboxes by using yourCheckboxName_1 ... in CCGetFromPost().
Best regards,
View profile  Send private message

Posts: 5971
Posted: 12/14/2004, 2:24 AM

I'd recommend that you post the code that you're using with ListBoxes, then someone may get an idea why the same code wouldn't work with checkboxes, or how to modify it.
Peter R.
YesSoftware Forums Moderator
For product support please visit
View profile  Send private message

Posts: 60
Posted: 12/14/2004, 6:37 AM

Here's the code I use for my ListBox Selection loop. It loops through each value in the list box to see if its selected or not.

For i = 0 To ProspectsGroupsGroupId.Items.Count - 1
If ProspectsGroupsGroupId.Items(i).Selected Then
sGroupId = ProspectsGroupsGroupId.Items(i).Value

With sqlSPPGroup
.CommandType = CommandType.StoredProcedure
.Parameters.Add("@Prospect", Convert.ToInt32(sProspectId))
.Parameters.Add("@Group", Convert.ToInt32(sgroupId))

End With

End If
Next i
View profile  Send private message
Posted: 12/14/2004, 11:55 PM


Which CCS control you are use? In case of CheckBoxList control, you can iterate values in the same manner as for ListBox. But if you use several CheckBoxes, you should check each by separate statement, i.e.

If CheckBox1.Checked Then ...
If CheckBox2.Checked Then ...


Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Internet Database

Visually create Web enabled database applications in minutes.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.