Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/04/2007, 12:46
programadorvip
 
Fecha de Ingreso: agosto-2006
Ubicación: en lima peru
Mensajes: 184
Antigüedad: 18 años
Puntos: 0
Re: Edit, Update, Cancel + Gridview

Cita:
Iniciado por programadorvip Ver Mensaje
Alguien De Ustedes Tiene Un Ejemplo De Edicion De Registros Con El Gridview A Traves De Codigo? No Usando Los Famosos Controlsitos Sqldatasource O Programando En El Aspx Sino En El Code Behind A Codigo Puro, Se Los Agradeceria.

bueno estuve viendo por las webs y deseo convertir una celda en un control alguien tiene idea?¿?¿

Código:
   If e.CommandName = "Edit" Then
            Dim index As Integer = Convert.ToInt32(e.CommandArgument)
            Dim customersGridView As GridView = CType(e.CommandSource, GridView)
            Dim row As GridViewRow = customersGridView.Rows(index)
            ' MsgBox(CStr(row.Cells.Item(3).Controls(0).ToString()))

            Dim txt As TextBox = CType(row.Controls.Item(4), TextBox)
            ' Session("t2") = CType(row.Cells(4).Controls(4), TextBox)
            ' Session("t3") = CType(row.Cells(6).Controls(6), TextBox)
            ' Session("t4") = CType(row.Cells(5).Controls(5), TextBox)
            ' wsUpdate.Credentials = System.Net.CredentialCache.DefaultCredentials
            Dim cad As String
            Try
                'cad = (wsUpdate.Actualizar_DIARIOS(Session("Id_Empresa"), t1.Text, t2.Text, t3.Text, 0, 0, 0, 0, 0, 0, 0, 0, 0, t4.Text, 0, 0, "", 0, 0, ""))
                GvdAsientos.EditIndex = -1
                DSDiarios.Merge(ws.Get_Diarios(Session("Id_Empresa")))

                GvdAsientos.DataSource = DSDiarios
                Me.GvdAsientos.DataBind()
                Me.tb_error.Text = cad

            Catch ex As Exception
                Response.Redirect("Wfrm_Error.aspx")
                Session("error") = ex.Message
            End Try
        End If