
- VBForums
- .NET and More
- C#
- 2.0 Copy content of DataGridView to another DatagridView located on another form.........
-
Jun 22nd, 2009, 02:43 PM
#1
Thread Starter
Member
Copy content of DataGridView to another DatagridView located on another form.........
Hi 2 all,
Here m facing problem while copying all the content of Datagridview to another datagridview located on another form..Please help me put from this, by providing some code snippet....
Thanks and Regards,
V'jay
-
Jun 23rd, 2009, 12:00 AM
#2
Re: Copy content of DataGridView to another DatagridView located on another form.....
Maybe you could let us know what problem you're facing so we know what issue it is we're trying to overcome. Where does the data come from in the first place? Is the grid bound or is it populated manually?
-
Jun 23rd, 2009, 12:11 AM
#3
Thread Starter
Member
Re: Copy content of DataGridView to another DatagridView located on another form.....
 Originally Posted by jmcilhinney
Maybe you could let us know what problem you're facing so we know what issue it is we're trying to overcome. Where does the data come from in the first place? Is the grid bound or is it populated manually?
It is populated manually....
-
Jun 23rd, 2009, 12:17 AM
#4
Re: Copy content of DataGridView to another DatagridView located on another form.....
So what is the code you're using at the moment and what goes wrong when you use it?
-
Jun 23rd, 2009, 01:02 AM
#5
Thread Starter
Member
Re: Copy content of DataGridView to another DatagridView located on another form.....
 Originally Posted by jmcilhinney
So what is the code you're using at the moment and what goes wrong when you use it?
till now i am not written any code.....just reply how do i start..
-
Jun 23rd, 2009, 01:08 AM
#6
Re: Copy content of DataGridView to another DatagridView located on another form.....
So you're not actually facing a problem while copying, because you're not actually copying yet. 
To access every row in the grid you can loop through its Rows collection.
To access every cell in a row you can loop through its Cells collection.
To access the data in a cell you can get its Value property.
If you need to transport this data from one form to another then wouldn't it be easier to NOT populate the grid manually? If you have your data in a collection and bind it to the grid then all you need to do is pass that collection to the other form and then bind it to that grid too.

- VBForums
- .NET and More
- C#
- 2.0 Copy content of DataGridView to another DatagridView located on another form.........
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|