This example shows how to properly update the Grid's underlying data source from a background thread, and avoid possible synchronization problems.
See Also:
Can I avoid the ArgumentOutOfRangeException when updating the Grid's data
Question Comments
Added By: Rongchen Jia at: 8/22/2013 12:51:30 AM
hi, i can see that you are updating a copy of the datasource and then rebind grid's datasouce to the new update.
I am wondering wont it be more efficient instead of doing
gridControl1.BeginInvoke(new MethodInvoker(delegate { gridControl1.DataSource = clone; }));
we do
gridControl1.BeginInvoke(new MethodInvoker(delegate { FillData(data, deleting); deleting=!=deleting}));
is there any problem in updating the DataTable data object directly on UI thread?
Added By: Gosha (DevExpress Support) at: 8/30/2013 10:50:31 AMHi Rongchen,
The main idea of updating the Grid data source from a background thread is that a long operation does not block the UI thread. If you update the data source in the UI thread, it will be blocked while the data source is being updated. So, there is no benefit in this approach.
Added By: Nikesh Parakh at: 11/15/2014 7:58:21 AMI am using same code which you have mention below using thread but still mine
View_ShownEditor(object sender, EventArgs e) is not calling which I am clicking on grid cell.