for (int i = 0; i < applicationDataGridView.Rows.Count; i++) { string[] Jobs = { "Network Engineer", "Financial Analyst", "Accountant", "Payroll Administrator", "Accountant Manager", "Sales Consultant" };
if (!applicationDataGridView.Rows[i].IsNewRow) { if (applicationDataGridView[4, i].Value.ToString() != Jobs) { applicationDataGridView.Rows.RemoveAt(i); i--; } } }
Above is the code that I have tried but It does not work. I want to delete the rows that doesn't contain the values in "Jobs" which I have assigned as a string. The Job column is column "4".