Cancelar
Código:
EditarPrivate Sub GridView1_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GridView1.RowCancelingEdit GridView1.EditIndex = -1 If cod_memtec.Text <> "" Then cargagrid("V_M....", "select * from ....., GridView1) 'esto carga la grilla Else cargagrid("V_M....", "select * from ....., GridView1) End If End Sub
Código:
Private Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing If GridView1.SelectedIndex >= 0 Then GridView1.EditIndex = e.NewEditIndex GridView1.PageIndex = 0 If cod.Text <> "" Then cargagrid("V_M....", "select * from ......, GridView1) Else cargagrid("V_M......", "select * from ......., GridView1) End If Else RegisterStartupScript("mensajes", mensaje("Debe seleccionar primero el registro ...")) End If End Sub
Update
Código:
el problema es aca, no me reconoce la linea que esta seleccionada y no me encuentra valor GridView1.SelectedRow.Cells(5).TextIf GridView1.SelectedIndex >= 0 Then Dim dt = CType(Session("TaskTable"), DataTable) Dim row = GridView1.Rows(e.RowIndex) Dim oDataRow As DataRow Dim oDataadapter As SqlDataAdapter Dim oDataSet As New DataSet Dim xDataSet As New DataSet Dim conectorx As New SqlConnection Dim conectorx2 As New SqlConnection conectorx.ConnectionString = sql_conexion Dim cod, cam As String Dim a As String = row.Cells(1).Text cam = GridView1.SelectedRow.Cells(5).Text
espero sus comentarios