Jump to content

Transferir dados


Go to solution Solved by Leandro LTM,

Recommended Posts

Posted

vb.net

Eu quero q percorra cada linha de uma coluna do datagridview e armazene e quando click no botao ele passe as informacoes para outro dridview em uma coluna especifica com o mesmo nome..

exemplo um dridview1 tem os campos nome ,quantidade ,preco e quando apertar o botao ele passe para o gridview2 quando o nome for igual o do gridview1 altere o valor do campo quantidade do gridview2

  • Solution
Posted

Meus amigos depois de muitas pesquisar consegui vai oq fiz e desculpa pois sou leigo em programacao.

For i As Integer = 0 To VendasDataGridView.RowCount - 1
            VendasDataGridView.Rows(i).Cells(2).Selected = True ' "0" indicates the first column

            For j As Integer = 0 To ProdutosDataGridView.RowCount - 1

                If Me.ProdutosDataGridView.Rows(j).Cells(0).Value = VendasDataGridView.Rows(i).Cells(0).Value Then

                    Me.ProdutosDataGridView.Rows(j).Cells(4).Value = VendasDataGridView.Rows(i).Cells(2).Value

                End If
            Next
        Next

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.