PC Review


Reply
Thread Tools Rate Thread

Copying DataGridViewRows to another DataGridView

 
 
carlostol
Guest
Posts: n/a
 
      15th Jun 2006

Hello,

How can i copy a selected DataGridViewRow who has been clicked to
another DataGridView Control in a dinamyc way?

I have this code on a button_click event:

DataGridViewRow r = dg1.Rows[dg1.CurrentRow.Index];
dg2.Rows.Add(r); <---------

But i keep geting the following exception message in line 2:

InvalidOperationException: Row provided already belongs to a
DataGridView control.

Thanks for your help,

Bye.


*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding List<T> to a DataGridView = DataGridView Empty admlangford@gmail.com Microsoft C# .NET 3 1st Oct 2008 07:59 AM
Refreshing Linq query to update second DataGridView when position in first DataGridView changes Arved Sandstrom Microsoft C# .NET 1 25th May 2008 04:06 AM
DataGridView (.NET 2.0 Windows Forms) Text wrapping in DataGridView Items Chris Hayes Microsoft Dot NET Framework 1 27th Aug 2006 06:07 PM
Clearing selection in DataGridView when user clicks outside the DataGridView control djyakov@gmail.com Microsoft Dot NET Framework Forms 0 16th Feb 2006 06:38 PM
Refreshing datagridview contents after a failed delete in bound datagridview Bob Microsoft VB .NET 0 5th Jan 2006 06:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:53 AM.