USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  mshflexgrid como adicionar o valor de um text nele
arm.g
Pontos: 2843
SÃO PAULO
SP - BRASIL
Postada em 28/06/2004 16:27 hs            
estou alimentando um mshflexgrid desta maneira
MSHFlexGrid1.FixedCols = 0 'Define o numero de colunas fixas
    MSHFlexGrid1.FixedRows = 1 'Define o numero de linhas fixas
    MSHFlexGrid1.Rows = 9 'Define o nuemro de linhas
    ' E bom lembrar que a primeira linha e para Cabecalho!!!!
    ' Com isso nossa grid tera apenas 9 linhas de dados
       
    'Monta Cabecalho
    MSHFlexGrid1.FormatString = "Cod Pro |Produto                                                                  |Unidade     |    QTD  |  Preço Uni.   |    Preço Total"
For i = 1 To 1
        MSHFlexGrid1.TextMatrix(i, 0) = TxtCodProduto.Text
        MSHFlexGrid1.TextMatrix(i, 1) = TxtProduto.Text
        MSHFlexGrid1.TextMatrix(i, 2) = TxtUnidade.Text
        MSHFlexGrid1.TextMatrix(i, 3) = TxtQuantidade.Text
        MSHFlexGrid1.TextMatrix(i, 4) = TxtPreUnitario.Text
        MSHFlexGrid1.TextMatrix(i, 5) = TxtPreTotal
    Next
 
só que ele só adiciona na 1 linha, como faço para ele adicionar na segunda, tipo quando eu for inserir o segundo produto, ele vai para a segundade linha, pois desde jeito ele substitui tudo que tem na primeira linha
 
agradeço desde jah
um abraço a todos
     
arm.g
Pontos: 2843
SÃO PAULO
SP - BRASIL
Postada em 28/06/2004 17:09 hs            
?
     
MasterPrint
MIRANDOPOLIS
SP - BRASIL
Postada em 28/06/2004 19:36 hs            
Caro Arm.g
Veja, voc ê está mandando carregar seu Grid com apenas uma linha, do jeito que está:
For i = 1 To 1
        MSHFlexGrid1.TextMatrix(i, 0) = TxtCodProduto.Text
        MSHFlexGrid1.TextMatrix(i, 1) = TxtProduto.Text
        MSHFlexGrid1.TextMatrix(i, 2) = TxtUnidade.Text
        MSHFlexGrid1.TextMatrix(i, 3) = TxtQuantidade.Text
        MSHFlexGrid1.TextMatrix(i, 4) = TxtPreUnitario.Text
        MSHFlexGrid1.TextMatrix(i, 5) = TxtPreTotal
Next

Normalmente, se faz o preenchimento com o banco de dados. Tipo assim:
    With Dados.rsGeral
    Do While Not .EOF
        fxgPesquisa.Rows = fxgPesquisa.Rows + 1
        Linha = fxgPesquisa.Rows - 1
        fxgPesquisa.TextMatrix(Linha, 0) = Trim(!NProtocolo & "")
        fxgPesquisa.TextMatrix(Linha, 1) = Format(Trim(!DataProt & ""), "dd/mm/yyyy")
        fxgPesquisa.TextMatrix(Linha, 2) = Trim(!Hora & "")
        fxgPesquisa.TextMatrix(Linha, 3) = Trim(!NProcesso & "")   'Format(Trim(!Hora & ""), "00:00:00")
        fxgPesquisa.TextMatrix(Linha, 4) = Trim(!Forma & "")
        fxgPesquisa.TextMatrix(Linha, 5) = Trim(!Objeto & "")
        fxgPesquisa.TextMatrix(Linha, 6) = Trim(!Apresentante & "")
        fxgPesquisa.TextMatrix(Linha, 7) = Trim(!Destino & "")
        
        .MoveNext
    Loop

        .Close
    End With

Aí, vai preenchendo as linhas com os dados existentes no BD.

Boa sorte e t+


Feliz aquele que passa o que sabe e aprende o que ensinaEmoçõesEmoçõesEmoções
     
Página(s): 1/1    


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

[:)] = 
[:P] = 
[:(] = 
[;)] = 

HTML DESLIGADO

     
 VOLTAR

  



CyberWEB Network Ltda.    © Copyright 2000-2025   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página