Home > Net >  DataGridView page spread value to each other
DataGridView page spread value to each other

Time:11-04

click on the arrow to the left above DGV DGV selected data to the right, at the same time to the right of the DGV increases over the data, could you tell me how to write

CodePudding user response:

 
Foreach (DataGridViewRow row in this. DataGridView1. SelectedRows)
{
Int index=this. DataGridView2. Rows. The Add (1);
For (int I=0; i <2; I++)
{
This. DataGridView2. Rows [index] Cells [I] Value=https://bbs.csdn.net/topics/row.Cells [I] Value;
}
}

CodePudding user response:

Click on the click event written inside the
Foreach (DataGridViewRow row in this. DataGridView1. SelectedRows)
{
Int index=this. DataGridView2. Rows. The Add (1);
For (int I=0; i <2; I++)
{
This. DataGridView2. Rows [index] Cells [I] Value=https://bbs.csdn.net/topics/row.Cells [I] Value;
}
}


In the second click click events to write this
Foreach (DataGridViewRow row in this. DataGridView2. SelectedRows)
{
Int index=this. DataGridView1. Rows. The Add (1);
For (int I=0; i <2; I++)
{
This. DataGridView1. Rows [index] Cells [I] Value=https://bbs.csdn.net/topics/row.Cells [I] Value;
}
}


  •  Tags:  
  • C#
  • Related