this refers to the current instance. The static method is not against the instance, but simply of type. So there is no this .
Therefore, you need to remove the static from the event handler declaration. Then the method will be against the instance.
You may also need to translate the code back into the user interface stream before trying to update the data grid view - if so, you will need the code something like this:
delegate void UpdateGridThreadHandler(Reply reply); private void ping_PingCompleted(object sender, PingCompletedEventArgs e) { UpdateGridWithReply(e.Reply); } private void UpdateGridWithReply(Reply reply) { if (dataGridView1.InvokeRequired) { UpdateGridThreadHandler handler = UpdateGridWithReply; dataGridView1.BeginInvoke(handler, table); } else { DataGridViewRow row = this.current_row; DataGridViewCell speed_cell = row.Cells["speed"]; speed_cell.Value = reply.RoundtripTime; } }
source share