mcgarry101 0 Newbie Poster

Hi,

Just wondering if anyone can help me with an issue I am having regarding updating a row in a gridview. I am using nested gridviews, and I want to compare two values, one of which exists in each grid. For some reason however, my gridview2_row_updating event fires but my gridview2_row_updated event never fires when I press the update button on the grid. I have included the required onrowupdated/onrowupdating text in my asp, but when I put breakpoints in the vb I can see that the 'updated' event is never entered. The code below doesnt make much practical sense, but i just using it to test a way to compare these 2 values and then output a message to the user

Any ideas?

thanks,

David.

Protected Sub GridView2_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs)
           
                ClientScript.RegisterStartupScript(Me.GetType(), "Message", "<SCRIPT LANGUAGE='javascript'>alert('updating');</script>")
           

        Protected Sub GridView2_RowUpdated(ByVal sender As Object, ByVal e As GridViewUpdatedEventArgs)
            Dim gvTemp As GridView = CType(sender, GridView)
            Dim test As String = CType(GridView1.Rows(e.AffectedRows).FindControl("lblBudgetAmt"), Label).Text
            Dim test2 As String = CType(gvTemp.Rows(e.AffectedRows).FindControl("txtPayAmt"), TextBox).Text
            

            If test <> test2 Then
            ClientScript.RegisterStartupScript(Me.GetType(), "Message", "<SCRIPT LANGUAGE='javascript'>alert('error');</script>")
            End If

            ClientScript.RegisterStartupScript(Me.GetType(), "Message", "<SCRIPT LANGUAGE='javascript'>alert('Budget lines updated successfully');</script>")

        End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.