Why is DataBinding not working a second time?

The error I received when I change the BindingSource data source

"the data binding cannot find a row that is suitable for all anchor lines that is suitable for all bindings"

this.RemoveAllBindings(); // My work-around for the meantime bdsOrder.DataSource = _ds.Tables["orders"]; // errors here on second time around(first time is blank datatable, second time is when i open existing record, then it errors), dataset comes from Remoting bdsOrderDetail.DataSource = _ds.Tables["order_detail"]; bdsPhoto.DataSource = _ds.Tables["order_photo"]; bdnPhoto.BindingSource = bdsPhoto; 

Working with the extension method of my assistant while perplexing the error "data binding cannot find a row ...".

 namespace MycComponentExtension { public static class Helper { public static void RemoveAllBindings(this Form form) { RemoveAllBindings((Control)form); } private static void RemoveAllBindings(this Control root) { foreach (Control c in root.Controls) { if (c.Controls.Count > 0) RemoveAllBindings(c); root.DataBindings.Clear(); } } 

What does the error “DataBinding cannot find the string ...” mean, if at all possible, can I fix this problem?

+4
source share
1 answer

I saw this error when not a single DataGridView was involved, but my data source was updated from another thread (naughty!), And my binding had FormattingEnabled = false. Changing both of them seemed to fix the problem.

+3
source

All Articles