I'm using the entityframework. I've bound it to a wingrid. The wingrid automaticly detects band[0] and band[1]. (Salaryscale and salaryscalestep).
Everything works fine on band[0] (add and update). But on band[1] the update works, but when trying to a add a new row on band[1] this error pops up:
Underlying DataSource does not support adding new rows.
I think this is strange, because both classes are generated by the entityframework. After reading the forum post I tried to add the list as an IBindableList like so:ugSalaryScale.DataSource = ((IListSource)salaryScales).GetList() as IBindingList;
But it didn't help. Exactly the same error. Is there something I can do about this?
So, what is the solution for this problem?
Casting the list into an IBindingList will do nothing. The list either implements that interface or is does not. It makes no difference whether you cast it or not.
In any case, it sounds like the problem is with the child list, not the parent list. So, the objects in the parent list of your data source must be exposing a property which is an IList an not an IBindingList as the child list. Or... the child object type doesn't have a public parametless constructor, so the BindingManager cannot create new instances.