两个datagridview 的传值问题
如何将datagridview1 中被选中的的某几行的数据赋值给datagridview2
------解决方案--------------------list <object> Dgv2Datasource = new list <object> ();
for (int i = 0; i <= this.DataGridView1.SelectedRows.Count - 1; i++)
{
object eachRow = this.DataGridView1.SelectedRows[i].DataBoundItem as object
Dgv2Datasource.Add(eachRow );
}
DataGridView2.Datasource = Dgv2Datasource ;
大概就这个意思,你测一下