I am trying to filter about 80,000 rows in a datagridview by making rows that do not meet the filter condition invisible but this seems to take forever. Is there anyway to do it better. Below is a sample code:
For Each row As DataGridViewRow In dgvSaleLogByProduct.Rows
If DatePart(DateInterval.WeekOfYear, DateTime.ParseExact(CDate(row.Cells("pDate").Value), "dd/MM/yyyy", Nothing)) <> _
DatePart(DateInterval.WeekOfYear, Today.Date) And _
DatePart(DateInterval.Year, DateTime.ParseExact(CDate(row.Cells("pDate").Value), "dd/MM/yyyy", Nothing)) <> _
DatePart(DateInterval.Year, Today.Date) Then
dgvSaleLogByProduct.Rows.Item(row.Index).Visible = False
End If
Next
I also want to be able to use the results of a filter as the source for another filter. You help will be very much appreciated.