I have a datagridview which has a table as the datasource.
I am trying to create a BindingSource in between so I can suspend the binding when updating the table.
This works:
this does not work:
I get the exception when launching the application.
I tried doing: tablesource.DataSource = table.DefaultView; and still got the exception.
If I do: tablesource.DataSource = table.DataSet; I don't get the exception, but at the same time the binding is not working and the datagridview is always empty when the table is populated.
What am I missing?
Thanks
I am trying to create a BindingSource in between so I can suspend the binding when updating the table.
This works:
Code:
DataTable table = new DataTable();
datagridview1.DataSource = table;
Code:
DataTable table = new DataTable();
BidningSource tablesource = new BindingSource();
tablesource.DataSource = table;
datagridview1.DataSource = tablesource;
I tried doing: tablesource.DataSource = table.DefaultView; and still got the exception.
If I do: tablesource.DataSource = table.DataSet; I don't get the exception, but at the same time the binding is not working and the datagridview is always empty when the table is populated.
What am I missing?
Thanks
Last edited: