I have a windows form that has two DataGridViews (DGVs) that will hold 25,000+ records and 21 columns each. I have successfully loaded each with the data from the DB using
this solved my problem:
array
^theRows = nullptr;
if (DG->Rows->Count == 0)//First Compilation
{
int NUMROWS = xxx;
theRows = gcnew array(NUMROWS);
for (int nr = 0; nr < DRH->Count; nr++)
theRows[nr] = gcnew DataGridViewRow();
//Do not remove the two following
DG->Rows->AddRange(theRows);
DG->Rows->Clear();
}
else //Update
{
theRows = gcnew array(DG->Rows->Count);
DG->Rows->CopyTo(theRows, 0);
DG->Rows->Clear();
}
for(int nr=0;nrLength;nr++)
{
theRows [nr]->SetValues("val1", "val2");
}
DG->Rows->AddRange(theRows);