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".
Sachin SinghPosted Oct 27, 2021, 6:03 AM
Samuel TohPosted Oct 27, 2021, 6:07 AM
Samuel TohPosted Oct 27, 2021, 5:54 AM
Sachin SinghPosted Oct 27, 2021, 5:49 AM
Samuel TohPosted Oct 27, 2021, 5:44 AM
Kirtesh ShahPosted Oct 27, 2021, 5:38 AM
Samuel TohPosted Oct 27, 2021, 5:33 AM
Samuel TohPosted Oct 27, 2021, 5:30 AM
Sachin SinghPosted Oct 27, 2021, 5:29 AM
Samuel TohPosted Oct 27, 2021, 5:25 AM
Kirtesh ShahPosted Oct 27, 2021, 5:21 AM
Kirtesh ShahPosted Oct 27, 2021, 4:52 AM
Srinivasan RamamoorthiPosted Oct 27, 2021, 4:42 AM
Don’t delete the records in the grid. Delete the rows or columns in dataset or data table and rebind to gridview