Respondida AGREGAR ITEMS A HIERICALFLEXGRID

  • jueves, 23 de febrero de 2012 14:07
     
     

    Hola, me pueden ayudar con este codigo solo puedo llenar una fila y cuando agrego el siguiente registro lo agrega en la misma columna lo esta chancando. Como puedo agregar una nueva fila?

    Private Sub btnAgregar_Click()
      Dim total As Double
      Dim i As Integer
      total = Val(txtPrecio.Text) * Val(txtCantidad.Text)
      i = 1
      With flex
        .ColWidth(1) = 1300
        .TextMatrix(0, 0) = "Código"
        .TextMatrix(0, 1) = "Nombre"
        .TextMatrix(0, 2) = "Precio"
        .TextMatrix(0, 3) = "Cantidad"
        .TextMatrix(0, 4) = "Total"
        .TextMatrix(i, 0) = dtcArticulo.BoundText
        .TextMatrix(i, 1) = dtcArticulo.Text
        .TextMatrix(i, 2) = txtPrecio.Text
        .TextMatrix(i, 3) = txtCantidad.Text
        .TextMatrix(i, 4) = total
      End With

    Pedro.


    Pedro Avila

Todas las respuestas

  • sábado, 25 de febrero de 2012 16:32
     
     Respondida

    Prueba de esta manera,fijate lo que esta en negrilla

    Private Sub btnAgregar_Click()
      Dim total As Double
      Dim i As Integer
      total = Val(txtPrecio.Text) * Val(txtCantidad.Text)
      i = 1
      With flex
        .ColWidth(1) = 1300
        .TextMatrix(0, 0) = "Código"
        .TextMatrix(0, 1) = "Nombre"
        .TextMatrix(0, 2) = "Precio"
        .TextMatrix(0, 3) = "Cantidad"
        .TextMatrix(0, 4) = "Total"
        .TextMatrix(i+1, 0) = dtcArticulo.BoundText
        .TextMatrix(i+1, 1) = dtcArticulo.Text
        .TextMatrix(i+1, 2) = txtPrecio.Text
        .TextMatrix(i+1, 3) = txtCantidad.Text
        .TextMatrix(i+1, 4) = total
      End With

    Saludos


    Capacitaciones Corporativas
    Si pequeña es la Patria, uno grande la sueña
    Rubén Darío
    Principe de las letras Castellanas
    Poeta Nicaragüense
    Ay Nicaragua, Nicaraguita Video Clip

    • Marcado como respuesta Pedro Avila sábado, 25 de febrero de 2012 18:13
    •