|Thanks for your input.
OK . . I have parsed the lines, adding them to a DataTable. I then bound to my DGV.
The time to populate the dgv decreased from 120 sec to 15 sec . . . nice improvement.
My program interacts with other DGVs and it is necessary to add rows to my DGV. Note that the program worked without using a DataTable, but was slow populating the data from the CSV file to the DGV. I have no problem with speed issues on other functions . . adding rows directly to the DGV, sorting, etc.
Now after using a DataTable as a data source for the DGV (only for populating the DGV) I get an error when other functions run to add rows to the DGV. I understand I could just work thru the bound DataTable, but I would prefer not. After I bound the data table to the dgv . . .
DataGridView1.DataSource = csvData; //csvData is DataTable
But when functions try to run that add rows to dgv,
I get the error . . .
Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound.
So I would like to use the datatable only to initially populate the dgv and then UNBIND, allowing the program to run as it did before, having resolved the speed issue in populating.
I have used the following attempting to unbind, but still get the same error above.
DataGridView1.Columns.Clear(); //NO . . this deletes ALL rows.
Any suggestions would be appreciated.