我有一个数据结构(bindingList),它从另一个线程接收数据,我已经绑定到一个抛出跨线程异常的dataGridView。如何调用 dataGridView 是 dataBound?这是一个winForm项目。为了清楚起见,这是我正在谈论的示例:
DataStore dStore = new DataStore();
dStore.ReceiveData += new ReceiveDataEventHndlr(data);
BindingList<mydataobj> myDataStructure = new BindingList<mydataobj>();
dataGridView.DataSource = myDataStructure;
// here's my cross threading issue
private void data(string s, double d)
{
myDataStructure.Add(new MyDataObj(s,d));
}