I'm trying to refresh datagridview after adding multiple records which were added programmatically, using bindingsource and datasource. My code:
Private Async Function RefreshData() As Task
Await Task.Delay(15000)
bs.EndEdit()
daProducts.Update(dtProducts)
DataGridView1.DataSource = Nothing
DataGridView1.DataSource = bs 'Insert your DataSource here
bs.ResetBindings(False)
...
When I call this function on form load event, it can't display any records.
Another thing is I get error if I don't use async function (because of setting DefaultCellStyle.Alignment).
My formload event: http://sudrap.org/paste/text/554747/