Need GridView Help - VB

Discussion in 'ASP .Net Web Controls' started by John G, Jun 22, 2006.

  1. John G

    John G Guest

    I have a GridView that I've placed a template field into with a single button
    that I want to be able to click that will update just the row the button is
    located. This is all while in regular view mode (not edit mode).

    I found a piece of VB code that sort of works but it goes through a loop and
    updates the same field in every row.

    Can anyone help me make this code only affect the current row?

    Protected Sub btnReturn_Click(ByVal sender As Object, ByVal e As
    System.EventArgs)

    Dim row As GridViewRow
    For Each row In gvRAMI.Rows
    Dim test As CheckBox = CType(row.FindControl("CheckBox1"),
    CheckBox)
    If test.Checked = True Then
    test.Checked = False
    gvRAMI.UpdateRow(row.RowIndex, False)
    End If
    Next

    End Sub

    TIA
     
    John G, Jun 22, 2006
    #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. Replies:
    2
    Views:
    1,877
  2. Miguel Dias Moura
    Replies:
    1
    Views:
    6,062
  3. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    18,024
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  4. mosscliffe

    GridView.SelectedRow - need Help Please

    mosscliffe, May 25, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    5,717
    =?Utf-8?B?RGF2aWQgSmVzc2Vl?=
    May 25, 2006
  5. Replies:
    0
    Views:
    1,691
Loading...

Share This Page