How to make edit mode close after update

3 posts, 0 answers
  1. Simón
    Simón avatar
    21 posts
    Member since:
    Dec 2008

    Posted 01 Dec 2008 Link to this post

    I'm trying to update the data from the grid using update_command, but after I click in the update button the edit form don't close, but the data is updated.

    If I try to change the text or the visibility of a label inside the update_command to notify the update, nothing happens with the label.

    I have in my code the item_updated sub, but it is never fired.

    What I must do to close the edit form after the update is done?

    Protected Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand
            Dim sql As String
            Dim conn As New ADODB.Connection
            Dim rs As New ADODB.Recordset


            conn.ConnectionString = ConfigurationManager.AppSettings.Get("strConexaoOracleAdodb")
            conn.Open()

            sql = "select * from pontos_digitais where cd_ponto_digital = '" & tbCdPontoDigital.Text & "'"
            rs.Open(sql, conn)

            Try
                If Not rs.EOF Then
                    sql = "call SSG_PACKAGE.PONTOS_DIGITAIS_EDITAR(" & _
                        rs("id_ponto_digital").Value.ToString & ",'" & rs("cd_ponto_digital").Value.ToString & "','" & tbNmPontoDigital.Text & "','" & _
                        tbTxtPontoDigital.Text & "','" & rdcbAreas.SelectedValue & "','" & rdcbUsinaEdit.SelectedValue & "','" & _
                        rs("id_tipo").Value.ToString & "','" & rs("id_dados_tm1").Value.ToString & "','" & rs("id_dados_ons1").Value.ToString & "','" & _
                        rs("id_dados_iec1").Value.ToString & "','" & rdcbFonte1A.SelectedValue & "', null, null, null, null, 0, 1,'" & _
                        tbTxtAlarme.Text & "',0,'" & tbTxtRetorno.Text & "',1024,0,0,0,0,0,1)"

                    conn.Execute(sql)

                End If
                rs.Close()
                conn.Close()
            Catch ex As Exception
                e.Canceled = True
            End Try

            Label1.Text = "Update Realizado"

        End Sub
  2. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 01 Dec 2008 Link to this post

    Hello Simón,

    Please share the declaration of your RadGrid here. A possible reason for this behavior may be AllowAutomaticUpdates property set as true.

    Alternatively I recommend you examine the following thread:
    Can't Get Out of Edit Mode

    Hope this helps.

    Best regards,
    Daniel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Simón
    Simón avatar
    21 posts
    Member since:
    Dec 2008

    Posted 02 Dec 2008 Link to this post

    Changing the AllowAutomaticUpdates property to false solved the problem.
    Thanks for the help.
Back to Top