Home » .Net FrameworkRSS

How do I link columns in one datagridview to another datagridview

I have 2 datagridviews on different tabs of a tabcontrol.

The user can input names into datagridview1 column1. I want these names to automatically appear in datagridview2 column1, in such a way that when rows in datagridview1 are added and removed the same rows are added and removed in datagridview2. I also want the column sort function to effect datagridview2.

Thanks

Brian

 

3 Answers Found

 

Answer 1

the easiest way would be to use an underlying datatable as the datasource for both datagridviews.

If you do this, adding or deleting rows, or sorting a column  in one datagridview  will have the exact same effect  to the other.

 

Answer 2

Thanks
 

Answer 3

Uh, it's poor Forum etiquette to mark your own post as the answer, unless you came up with adifferent solution. Then it helps to post that solution so others with the same problem can find an answer.

Normally you would mark the Post that solved your problem as the Answer and any posts that gave you some helpful information as Helpful

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter