I'm contracting a Windows Form application. I am not getting my datagrid
popular with a threading , the following error appears:
"Invalid thread operation: datagrid control accessed from a thread in the thread it was created on.
I'm contracting a Windows Form application. I am not getting my datagrid
popular with a threading , the following error appears:
"Invalid thread operation: datagrid control accessed from a thread in the thread it was created on.
A UI (control) screen element in Winforms and WPF does not allow access by other threads or multiple threads.
The UI element can only be accessed by the thread that was created on it.
What you can do is to use delegates ...
Invoke(new Action(() =>
{
if (dataGridView1.CurrentCell.RowIndex < dataGridView1.RowCount )
{
dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Selected = false;
dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex + 1].Selected = true;
}
}));