I have a long running method that must run on UI thread. (Devex - gridView.CopyToClipboard()
)
I do not need the UI to be responsive while c
This is because you call a long running method synchronously in your main application thread. As your applicaton is busy it does not respond to messages from windows and is marked as (Not Responding) until finished.
To handle this do your copying asynchronously e.g. using a Task as one simplest solution.
Task task = new Task(() =>
{
gridView.Enabled = false;
gridView.CopyToClipboard();
gridView.Enabled = true;
});
task.Start();
Disable your grid so nobody can change values in the GUI. The rest of your application remains responsive (may has side effects!).