انتقال سطرهای تیک خورده DataGridView به ListBox
انتقال سطرهای تیک خورده DataGridView به ListBox می توانید کد زیر را در رویداد Click یک دکمه بنویسید :
this.listBox1.Items.Clear(); foreach (DataGridViewRow row in this.dataGridView1.Rows) { DataGridViewCheckBoxCell cell = row.Cells[0] as DataGridViewCheckBoxCell; if (cell != null) { if (cell.Value == cell.TrueValue) { this.listBox1.Items.Add(row.Cells[1].Value.ToString()); } } }
خروجی