특정 조건이 충족되면 셀을 지우려고합니다. 그러나 그것은 작동하지 않습니다.DataGridView 셀의 값을 프로그래밍 방식으로 설정하는 방법은 무엇입니까?
UPDATE는
Private Sub DataGridView1_CellLeave(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellLeave
Dim laspac As Int16 = DataGridView1.Columns("LASPAC").Index
If e.ColumnIndex = laspac And DataGridView1.Rows(e.RowIndex).Cells("CType").Value.ToString.Trim() = "B" Then
Dim B_LASPAC As DataGridViewCell = DataGridView1.Rows(e.RowIndex).Cells("LASPAC")
Dim A_LASPAC As DataGridViewCell = DataGridView1.Rows(e.RowIndex - 1).Cells("LASPAC")
If B_LASPAC.Value.ToString.Trim.Length <> 0 Then
If Convert.ToDecimal(B_LASPAC.Value) + Convert.ToDecimal(A_LASPAC.Value) > 0 Then
B_LASPAC.Value = ""
End If
End If
End If
End Sub
박사 프로이트는 제목을 인정 :) – thumbmunkeys
"그것이 작동하지 않는다"는 것이 정확히 무엇을 의미합니까? 어떤 오류가 있습니까? 특정 조건/절대로 작동하지 않습니까? 등 – varocarbas
그것은 어떤 오류도주지 않습니다 .. 단지 작동하지 않습니다. 못. – Arbaaz