I have a datagridview in form 1 which contains unbound data. How can I transfer the data from datagridview in another datagridview2 which is located in form2? Give me some suggestions please!
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you had the DataGridView bound to a table, you would just set a reference in Form2 to the table. In your case, you probably want to have a reference to the actual DataGridView in the second form.
It’s not the best programming style from a maintenance perspective — it’s better to use a data source.
Here is a simple idea of one way to show the second DataGridView with the data from the first DataGridView. It’s not perfect, but it should show you the idea.
Again, though, this would be a lot easier using a DataSource.