winFom DataGridView CheckBox是否选中

来源:互联网 发布:mysql trunc函数 编辑:程序博客网 时间:2024/04/30 07:21

foreach (DataGridViewRow dgvRow in dgvShow.Rows)
                {
                    maxSeqinarchivenum++;
                    if (dgvRow.Cells[0] is System.Windows.Forms.DataGridViewCheckBoxCell)
                    {
                        DataGridViewCheckBoxCell dc = (DataGridViewCheckBoxCell)dgvRow.Cells[0];
                        if (dc.FormattedValue.ToString() == "True")
                        {

                            MessageBox.Show("True");

                        }
                        else
                        {
                            MessageBox.Show("False");
                        }
                    }
                }

原创粉丝点击