Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > How to select all or deselect all checkboxes in datagrid...

Thread Tools

How to select all or deselect all checkboxes in datagrid...

Al Knowles
Posts: n/a

This does not work....

Sub SetCheckBoxValues(ByVal ab_on_off As Boolean)

Dim ditem As DataGridItem
Dim ckbx As CheckBox

For Each ditem In DataGrid1.Items
ckbx = CType(ditem.Cells(0).Controls(1), CheckBox)
If ab_on_off Then
ckbx.Checked = True
ckbx.Checked = False
End If

ditem.Cells(0).Controls(1) = ckbx

End Sub

...because property "item" is read-only.

Is there a way to accomplish my objective without javascript? (Only
because I don't know my way around in javascript! But I'll accept
javascript examples if that's all there is...)

Please advise.

Suggestions appreciated. Thanks in advance.

*** Sent via Developersdex ***
Don't just participate in USENET...get rewarded for it!
Reply With Quote

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
How to deselect item on single select listbox? rpress ASP .Net Web Controls 5 01-09-2006 06:15 PM
How To Deselect From Select Box in IE Notorious Javascript 2 07-15-2005 05:33 PM
implement "select all" button to select all checkboxes Matt ASP General 2 01-11-2004 01:08 PM
Deselect any selected items in a select form field with multiple attribute? Keiron Waites Javascript 1 10-21-2003 10:24 AM