Is your DoWork accessing the DataGridView directly? You are not supposed to do that. Windows has always not supported accessing a window by any thread that did not create the window. It can work sometimes but Microsoft does not guarantee it will work. You can create a collection (such as a List) for the DataGridView (IP) data and bind the collection to the DataGridView then the DoWork can use the collection. Descriptions of binding a collection to a DataGridView is integrated in the DataGridView Control Overview. I suggest using a BindingSource component as mentioned there. Also see Data Binding - Windows Forms .NET Framework.
That might also solve the problem in your Looping through Datagridview with BackgroundWorker in vb.net.