I have datagridview in form1 and i can add rows in it... now on button click i want to show the same datagridview in another form with same rows which i have added already in form1 datagridview...can someone help me with this??

Recommended Answers

What is the code you already have in your click handler?

Jump to Post

All 4 Replies

What is the code you already have in your click handler?

In button click i just made another new form to open...actually if it is textbox i can able to get the textbox text in form1 and dispaly it in from2's textbox but it when it comes to datagridview i dont know how to get all the rows from form1's datagridview and diaplay it in form2's datagridview.. by creating object for form1 in form2 i can access the form1's datagridview controll but i couldn't display it in form2.

You should have a class for your model. The model should have a property which exposes the collection of data. This becomes the DataSource for both DataGridViews.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.