How to remove a data row based on a condition in for each data row loop?