winform中DataGridView使用DataGridViewCheckBoxColumn实现RadioBox单选功能

private void dgvMaterial_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
for (int i = ; i < dgvMaterial.Rows.Count; i++)
{
DataGridViewCheckBoxCell ck = dgvMaterial.Rows[i].Cells[] as DataGridViewCheckBoxCell;
if (i != e.RowIndex)
{
ck.Value = false;
}
else
{
ck.Value = true;
}
}
}
上一篇:java web学习总结(二十四) -------------------Servlet文件上传和下载的实现


下一篇:ionic cordova