如何将选定的行从 Datagridview 传输到列表视图?(对不起,伙计们,我以前用错误的方式问这个问题!!)
private void button1_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dataGridView1.SelectedRows)
{
lvt = new ListViewItem();
lvt.SubItems.Add(row.Cells[1].Value.ToString());
lvt.SubItems.Add(row.Cells[2].Value.ToString());
lvt.SubItems.Add(row.Cells[3].Value.ToString());
lvt.SubItems.Add(row.Cells[4].Value.ToString());
listView1.Items.Add(lvt);
}
}