Well, since the DataGridView is a GUI control, you will not be able to make changes to it from another thread. You will have to send a message to the main GUI thread. Fortunately, C# has good support for this. Write a method (presumably in your main form class) which does the actual work:
public void SetRowFromWebResult(int row, Color background, ...)
{
// ...
}
Then, within your thread, use the Invoke
method on the form object (not the delegate):
myForm.Invoke(() => myForm.SetRowFromWebResult(row, background, ...));
So presumably you would run your HTTP request in a thread like this:
int row = ...;
var myThread = new Thread(() =>
{
// Fire off the request
var request = WebRequest.Create(...);
var response = ...;
// Calculate the parameters (e.g. row background color)
Color background = (response.Code == ...) ? ... : ...;
// Tell the GUI to update the DataGridView
myForm.Invoke(() => myForm.SetRowFromWebResult(row, background, ...));
});
myThread.Start();