datagridview の行の色を変更する必要がありますが、コードが機能しません。「Quantity という名前の列: が見つかりません。パラメーター名: columnName」というエラーが常に表示されます。
これが私のコードです:
Private Sub DataGridView1_CellFormatting(ByVal sender As Object, ByVal e As DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting
For i As Integer = 0 To Me.DataGridView1.Rows.Count - 1
If Me.DataGridView1.Rows(i).Cells("Quantity:").Value < 5 Then
Me.DataGridView1.Rows(i).Cells("Quantity:").Style.ForeColor = Color.Red
End If
Next
End Sub
修正を手伝ってください。ありがとうございました。