Bonjour à vous,
Je recherche un moyen de changer la couleur d'une cellule si celle-ci a une certaine valeur, ma colonne est déclaré en int et j'utilise la fonction cellformating. Je n ai aucun message d'erreur mais il y a aucun changement.
Pourriez vous m'aider svp.
Merci.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 Private Sub Table1datagridview_CellFormatting(sender As Object, e As DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting If Table1datagridview.Columns(e.ColumnIndex).Name.Equals("Age") Then If CDbl(e.Value) < 10.0 Then e.CellStyle.BackColor = Color.Red Else e.CellStyle.BackColor = Color.White End If End If End Sub
Partager