dataGridView cell value to textBox | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

dataGridView cell value to textBox

Dear Sir, How to get dataGridView cell value from Form1 to textBox of Form2 in C# winforms

8th Aug 2017, 3:36 PM
Theikdi Maung
Theikdi Maung - avatar
2 Answers
+ 4
thank sneeze I got it
11th Aug 2017, 11:47 AM
Theikdi Maung
Theikdi Maung - avatar
+ 1
Have a look at this code form1.textbox1.text = datagridview1.item("column name/column index",datagridview1.currentrow.index).value.tostring() from this post https://www.daniweb.com/programming/software-development/threads/211040/display-datagridview-selected-row-in-textboxes#post947569 And this post https://www.dotnetperls.com/datagridview-tutorial Why are there 2 forms. Is the second form a dialog or a child form.
8th Aug 2017, 9:16 PM
sneeze
sneeze - avatar