Is it possible that a thread that updates a grid give me problems? For some
reason, when the for loop is really big (30000+ rows in grid), I get "Object
reference not set to an instance of an object" or "External component has
thrown an exception" in some rows. And it always happens in the first few
records (rec. 30-40 when I'm stepping through the code or rec. 10-18 when
I'm not).
This is the code:
private void runProcess()
{
ThreadStart thr_markGrid = new ThreadStart(markAuditGrid);
Thread AZMThread = new Thread (thr_markGrid);
AZMThread.Start (); //starting the thread
}
private void markAuditGrid()
{
for(int i=0;i<iRows; i++) //iRows = 35000 - number of rows in grid
{
if(dataGrid_auditAddress.IsSelected(i) == true)
{
dataGrid_auditAddress[i,5] = "MARKED";
}
}
}