Ver Mensaje Individual
  #7 (permalink)  
Antiguo 13/01/2007, 10:09
Avatar de magosc
magosc
 
Fecha de Ingreso: diciembre-2006
Mensajes: 72
Antigüedad: 18 años, 1 mes
Puntos: 0
Exclamación Re: ¡este Datagrid!!!!!!

Hola Stream....
Si q soy bruto!!! .... Fijate q tu codigo q posteaste..si me funciono...sin embargo cuando trato de pasar mi tabla a tu codigo ...crees??...q he podido!! ....
He hecho varias cosas por ejemplo:

Código:
 Function LoadID() As ICollection
      adp = New SqlDataAdapter("select Cant AS Cantidad, Exist AS Existencia from PruebaX", cnx)
      adp.Fill(DS, "LoadID")
      cnx.Close()
      LoadID = New DataView(DS.Tables("LoadID"))
      '--------------------------- 
      '--------------------------- 
      DS.Tables.Remove("LoadID")
         
   End Function
Luego en el Load puse esto:

Código:
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      If Not IsPostBack Then
               LoadID()
         
      End If
   End Sub
Luego la parte final del codigo lo deje asi como tu la enviaste:

Código:
 Protected Sub GridView1_SelectedIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSelectEventArgs) Handles GridView1.SelectedIndexChanging
      Dim dr As GridViewRow = Me.GridView1.Rows(e.NewSelectedIndex)
      If Not dr Is Nothing Then 'AndAlso dr.RowState = DataControlRowState.Selected Then
         Dim lblCantidad As Label
         Dim txtResultado As TextBox
         Dim lblExistencia As Label

         lblCantidad = dr.Cells(0).FindControl("lblCantidad")
         lblExistencia = dr.Cells(1).FindControl("lblExistencia")
         txtResultado = dr.Cells(3).FindControl("txtResultado")

         txtResultado.Text = CDec(lblCantidad.Text) * CDec(lblExistencia.Text)

      End If
   End Sub
La estructura de la tabla, la deje exactamente como la posteaste....

Y precisamente, la columna del resultado quisiera guardar..solo que no encuentro como.... Gracias Stream....

PD.: me pregunto como es q aguantas tanta ignorancia de mi parte....jeje...

Gracias Stream!!