Solution :
The problem is that you are trying to call the GetGridData from the background thread. This method generally accesses several WPF controls which are connected to your main thread. Any attempt to access them from the background thread will lead to your error.
So in order to get back to your correct thread you must use below approach : SynchronizationContext.Current.Post.
But in your particular case it appears like your majority of the work that you are doing is UI based. So you must be creating the background thread just to go immediately back to your UI thread and do some relevant work. You need to completely refractor your code so that it can do your expensive work on your background thread and then it can post the new data to your UI thread afterwards
OR
Also, another solution for you is ensuring that your controls are created in UI thread only and not by the background worker thread for example.