首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C# DataGridView CheckBox单选兑现

2012-09-25 
C# DataGridView CheckBox单选实现private void dgvCustomerCellClick(object sender, DataGridViewCellEv

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;        }

热点排行