我使用此函数来查看是否所有特定列的True值都为DataGridViewCheckBoxCell。然而,它失败了,因为它似乎认为当前值是假的。我在_CellContentClick事件中运行这段代码,在它被赋值给单元格之后,有没有其他地方可以运行它?
Private Function AllTasksAreCompleted() As Boolean
Dim result As Boolean = True
For Each dgvRow As DataGridViewRow In Me.gridTasks.Rows
Dim tempCBcell As DataGridViewCheckBoxCell = GetCheckBoxCell(dgvRow, "colCompleted")
If Not tempCBcell.Value.ToString = "True" Then
result = False
Return result
End If
Next
Return result非常感谢科迪
发布于 2009-09-21 19:52:09
CurrentCellDirtyStateChanged或CellValueChanged
但是,有时我发现离开CheckBoxColumn ReadOnly并显式切换CheckedState是很容易的:
cell.Value = Not cell.value....and,那么在进一步的处理中,复选框值应该是预期的
https://stackoverflow.com/questions/1456428
复制相似问题