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

Discussion in 'ASP .Net Datagrid Control' started by Al Knowles, Dec 1, 2003.

  1. Al Knowles

    Al Knowles Guest

    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
    Else
    ckbx.Checked = False
    End If

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


    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 http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Al Knowles, Dec 1, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rpress

    How to deselect item on single select listbox?

    rpress, Jan 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    1,584
    rpress
    Jan 9, 2006
  2. Matt
    Replies:
    2
    Views:
    228
    Roland Hall
    Jan 11, 2004
  3. Keiron Waites
    Replies:
    1
    Views:
    127
    Keiron Waites
    Oct 21, 2003
  4. Notorious

    How To Deselect From Select Box in IE

    Notorious, Jul 15, 2005, in forum: Javascript
    Replies:
    2
    Views:
    115
    Notorious
    Jul 15, 2005
  5. armyofda12monkeys

    deselect select list options in IE6

    armyofda12monkeys, Jul 6, 2007, in forum: Javascript
    Replies:
    0
    Views:
    193
    armyofda12monkeys
    Jul 6, 2007
Loading...

Share This Page