I’m trying something like the code below. The difference being the BindingSource and DataGridView are created by the designer of my Windows Forms form.
What happens is the data binding seems to hang. The operation is asynchronous, so the execution continues until you get an error because there are no columns on the datagridview
I think that is the problem because I placed breakpoint inside the dataGridView_DataBindingComplete event and it is never hit, or it takes a long time.
The data source is a list with a single item, so load should not be an issue. I also tried changing the order of the DataSource assignments but no luck.
public void OpenForm()
{
L = new BindingList<conhecimento>();
L.Add(new conhecimento());
BS.DataSource=L;
DG.DataSource = BS;
myForm.Show()
}
Have you tried skipping the BindingSource and just doing: