Bonjour, avec l'aide de chrismonoye et graffito j'ai pu affiché mon fichier texte dans un datagridview1, et à présent j'ai ajouter un code pour afficher une couleur différente d’après le texte présent dans la colonne, dégrée, mais voila le problème qui se pose, est que la couleur déborde sur la ligne suivante, voici un Screenshots du résultat, et mon code qui contient donc une erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 Private Sub DataGridView1_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting If DirectCast(Me.DataGridView1.Rows(e.RowIndex).Cells("Degré").Value, String) = "AUTO" Then DataGridView1.RowsDefaultCellStyle.BackColor = Color.Green ElseIf DirectCast(Me.DataGridView1.Rows(e.RowIndex).Cells("Degré").Value, String) = "MANU" Then DataGridView1.RowsDefaultCellStyle.BackColor = Color.Yellow ElseIf DirectCast(Me.DataGridView1.Rows(e.RowIndex).Cells("Degré").Value, String) = "EROR" Then DataGridView1.RowsDefaultCellStyle.BackColor = Color.Red End If End Sub
Partager