
在C#编程时候,如何将一个dataGridView中选中行的某一个或某几个字段添加到另一个datagridView之中啊
展开全部
(1)取出string s = dataGridView1.SelectedRows[i].Cells[j].Value.ToString();
(2)构建DataGridViewRow,DataGridViewRow row = new DataGridViewRow();
(3)设定值:row.Cells[i].Value = s;
(4)添加row:dataGridView2.Rows.Add(row)
(2)构建DataGridViewRow,DataGridViewRow row = new DataGridViewRow();
(3)设定值:row.Cells[i].Value = s;
(4)添加row:dataGridView2.Rows.Add(row)
追问
谢谢,我明天试试!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询