Datagridview copy data

bones

Well-known member
Joined
Aug 23, 2014
Messages
143
Programming Experience
Beginner
VB2010
I've found some similar situations but nothing identical...

I have two forms, each with a dgv1 and neither is bound to a table or dataset.

I have data captured by a control button to dgv1 on form1, [4 columns] That data gets captured, charted and then cleared for the next round of captures.

I have second dgv1 on Form2. After the capture is performed in above step, I need to copy the captured data to dgv1 on form2 where I have created matching columns for the data plus several more columns that will be coded to do data analysis.

I need to insert a blank row in form2 dgv1 before the copied data as a data separation method.

I occurs to me that I could add code to the command button that clears the captured data on form1 dgv1 to do the copying operation just before the data is cleared.

Not certain of the best approach to take here and need advice and assistance with some code.
 
I would suggest that you do bind the first grid at least. When you capture your data, put it into an appropriate data structure so that you can bind it to the grid for display. When it comes time to clear the first grid, you can simply unbind it. You can then pass that same data structure to the second form and it can do whatever is appropriate to add that data to its own grid.
 
Back
Top