Hi,
Guys, please help me, I need your help. I wanted to identify the conflicted schedule of each of the section. If there’s conflict then the two or more subjects that are conflict will be colored to make then noticeable. They are in datagridview. I don’t know what’s wrong but there are some that although they are conflict they are not highlighted. Here’s my code:
For item As Integer = 0 To DataGridClass.RowCount - 1
For item2 As Integer = 0 To DataGridClass.RowCount - 1
If DataGridClass.Rows(item).Cells(ClassID).Value <> DataGridClass.Rows(item2).Cells(ClassID).Value And DataGridClass.Rows(item).Cells(Section).Value = DataGridClass.Rows(item2).Cells(Section).Value And DataGridClass.Rows(item).Cells(Day).Value = DataGridClass.Rows(item2).Cells(Day).Value And (DataGridClass.Rows(item).Cells(TimeStart).Value >= DataGridClass.Rows(item2).Cells(TimeStart).Value And DataGridClass.Rows(item).Cells(TimeEnd).Value <= DataGridClass.Rows(item2).Cells(TimeEnd).Value) Then
DataGridClass.Rows(item).DefaultCellStyle.BackColor = Color.Aquamarine
DataGridClass.Rows(item2).DefaultCellStyle.BackColor = Color.Aquamarine
End If
item2 = item2 + 1
Next
item = item + 1
Next