Schriftfarbe bei DataGridView

  • VB.NET

    Schriftfarbe bei DataGridView

    Hallo Zusammen
    Ich habe in einem DataGridView eine Datumsspalte, dort rufe ich ab, wenn der Wert älter ist als das heutige Datum, soll mit diese Zeile grau werden.
    Wie bringe ich das hin? Mein Code, das farbliche funktioniert aber logischerweise nicht.

    VB.NET-Quellcode

    1. Dim spl() As String
    2. For Each line As String In File.ReadAllLines(pfad)
    3. spl = line.Split(";")
    4. Dim arr(1) As String
    5. arr(0) = spl(0) 'Datumsspalte
    6. arr(1) = spl(1)
    7. DataGridView1.Rows.Add(arr)
    8. If arr(0) < FormatDateTime(Now, DateFormat.ShortDate) Then
    9. DataGridView1.ForeColor = Color.Gray
    10. End If
    11. Next