Make sure the update of datagrid is on UI thread.