如何在DataGridViewCheckBoxCell中获得类似于DataGridViewCheckBoxCell中的CheckBox之类的控件?
foreach (DataGridViewRow row in dgvPerformance.Rows)
{
DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells[6];
//I need to find CheckBox in chk
}
答案 0 :(得分:0)
您无法从CheckBox
获得DataGridViewCheckBoxCell
控件,但您可以获得其值:
foreach (DataGridViewRow row in dgvPerformance.Rows){
DataGridViewCheckBoxCell chk = row.Cells[6] as DataGridViewCheckBoxCell;
if(chk != null && (bool)chk.Value){
//checked, do something
}
}