Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Guys,i want to know how to pass one datagridview rows values in another datagridview rows

What I have tried:

C#
for (int i = 0; i < dataGridView2.Rows.Count; i++)
       {
           for (int a = 0; a < dataGridView1.Rows.Count; a++)
           {
               dataGridView1.Rows[a].Cells[0].Value = dataGridView2.Rows[i].Cells[0].Value.ToString();
           }
       }
Posted
Updated 15-Dec-16 1:43am

1 solution

Write the data from first grid to DataTable and then set the dataaource for the second grid.

Hope this helps you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900