读书人

C# DataGridView CheckBox单选兑现

发布时间: 2012-09-25 09:55:59 作者: rapoo

C# DataGridView CheckBox单选实现

 private void dgvCustomerCellClick(object sender, DataGridViewCellEventArgs e)        {            if (e.ColumnIndex == -1 || e.RowIndex == -1) return;            for (int i = 0; i < dgvMaterial.Rows.Count; i++)            {                DataGridViewCheckBoxCell checkcell = (DataGridViewCheckBoxCell)dgvMaterial.Rows[i].Cells[0];                checkcell.Value = false;            }            DataGridViewCheckBoxCell ifcheck = (DataGridViewCheckBoxCell)dgvMaterial.Rows[e.RowIndex].Cells[0];            ifcheck.Value = true;        }

读书人网 >C#

热点推荐