I use this blog to record programming notes from both work and personal projects. I don't put everything I do on here but when I write a handy script or figure something out that I don't want to forget for next time, I add it to this blog. Feel free to use this blog in your own projects.
Test Menu
- Commentary
- Deals
- Coupons
Nov 22, 2011
Databound Checklist - Check All by Default
The following code shows an easy way to loop through the list of checkboxes and select each one:
''' <summary>
''' checks all of the checkboxes by default
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Protected Sub chkListParameterSelections_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkListParameterSelections.DataBound
Try
For Each li As ListItem In chkListParameterSelections.Items
li.Selected = True
Next
Catch ex As Exception
ErrorLogging.LogError(ex, "ctrlStatistics.chkListParameters_DataBound")
End Try
End Sub
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment