How to transport information from datagridview to a textbox in another form?

Asked

Viewed 543 times

0

I have the following question on my application. I have Form1 and in this Form1 I have two textbox, txt_cod.text and txt_fornec.text and a search button, when I click on the search button of this Form1, I call form2 which brings me a datagridview populated with two columns, the cod_vendor column and Vendor name.

Now what I need, that when the user double-click on the datagridview line, he carry the information from the selected line to the Form1 within his specific textbox, eg. cod_vendor column within txt_cod.text and vendor name column within txt_fornec.text from Form1.

How to do this?

  • https://answall.com/questions/55565/pegar-o-dados-pesquisafornecedor-e-colocar-no-form-cadastro-de-produtos/198267#198267

  • 1

    Thank you very much Rovann, you yourself had already helped me in a question just like I had done myself, I’m sorry but I didn’t remember, and that’s right here thank you very much.

  • no problem, baby

  • Now as I do not open another main form, for example I opened the main form I called the secondary form I clicked on the line and it is opening another main form and not taking the information to the main form that is already open, how to make it open only one form.

  • take a look at this example: https://answall.com/questions/55565/pega-dados-searcherproviders-e-colocar-no-form-product registration/198267#198267 ... in your main form, you have to open the secondary as showdialog and in your secondary, when you choose, give the this.DialogResult = DialogResult.OK and do not open another form

  • Rovann I do as you told me it brings nothing in the main form.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.