I've got a hierarchical datasource that is and observable collection of "TopLevel" objects. These "TopLevel" objects can in turn contain an observable collection of "ChildLevel" objects.
When I initially create the datasource, there are no child objects. Then once the grid is displayed, I am trying to add a child object to a top level object. Running through the code, once it's all done I can look at the grid datasource and see that the child object is now held under the correct top level item. I also fire an OnPropertyChanged event when the observable colelcion of child objects is added to, but no matter what, the grid does not display the new child item.
If I set the datasource to null and then back to the collection, it then shows the child item in place, so somewhere the grid is not getting the message to refresh.
I've read through lots of posts on adding new records etc... I've added a parameterless ctor to the top and child level objects (although I don't actually call that constructor when creating the object - do I need to do this?), but nothing seems to help.
The grid updates fine when I change properties on objects it's already displaying so what am I missing?
Cheers,
Rob
Have you implemented INotifyPropertyChanged in your class? Implementing IBindingList also helps.