参考代码
private void btn_Sure_Click(object sender, EventArgs e) { try { for (int i = 0; i < myDataGridView1.Rows.Count; i++) { if (myDataGridView1.Rows[i].Cells["IsSelect"].Value != null) { if ((bool)myDataGridView1.Rows[i].Cells["IsSelect"].Value) { listdataRow.Add(myDataGridView1.Rows[i]); } } } this.DialogResult = System.Windows.Forms.DialogResult.OK; } catch (Exception ex) { MessageBoxShow(ex.Message); } }
时间: 2024-10-11 15:57:11