Question : Check if cell has changed.

Hi,
Id like to colour of a cell in a editable datagridview if that cell changes its (original) value.

Any ideas?

Answer : Check if cell has changed.

Handle the CellValueChanged event of the DataGridView:
1:
2:
3:
4:
5:
Private Sub DataGridView1_CellValueChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellValueChanged
    If e.ColumnIndex >= 0 AndAlso e.RowIndex >= 0 Then
        Me.DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Style.BackColor = Color.Coral
    End If
End Sub
Random Solutions  
 
programming4us programming4us