|
Private Sub DataGridView1_CellFormatting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting
Dim mycon As New comm
If DataGridView1.Rows(e.RowIndex).Cells(1).Value.Equals("一级") Then
e.CellStyle.BackColor = Color.LightGray
End If
If DataGridView1.Rows(e.RowIndex).Cells(1).Value.Equals("二级") And mycon.GetValue_int("select count(级别) from grade where 二级标准='" & DataGridView1.Rows(e.RowIndex).Cells(2).Value & "'") > 0 Then
e.CellStyle.BackColor = Color.LightGray
End If
If e.ColumnIndex = 5 Then
e.CellStyle.ForeColor = Color.DarkRed
End If
End Sub |
|