Binding with BindingSource
-
I have a strnge situation thta I just can't understand, any help or leads would be appreciated In my data layer I create BindingSource objects: public abstract class SimpleObjects : System.Data.DataTable { protected BindingSource binding = new BindingSource(); protected void Init() { sqlAdap.SelectCommand = selectCommand; sqlAdap.TableMappings.Add(tableMapping); sqlAdap.FillSchema(this, SchemaType.Mapped); binding.DataSource = this; } public BindingSource Binding { get { return binding; } } } I make the BindingSource (binding) object available as a property for all my SimpleObjects for forms to use. Wrks well in most cases but my problem is sometimes the binding goes berzerk when I add DataRows to certain SimpleObjects and it seems to happen when you add rows to child Tables. What happens most of the time is a DataGridView showing a child object will show a row in blue but if I ask the currently binded Object to the BindingSource, it returns me usually the first row. This definitelly happens only if a DataRow was added. Not sure What is happenning and not sure what to do. Any help would be greatly appreciated.