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
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