Hi,
I have a recursive data structure which I am binding to the grid. I have a class "Patient" which Implements INotifyPropertyChanged and has another property public BindingList<Patient> Children. Which can have recursive objects. I am creating BindingList<Patient> to bind to the grid. Everything works fine until I try to add another child at run time to a row which does not have anything in "Children" Property. Nothing happens. I am attaching a sample can some one please let me know what I am doing wrong here?
The sample you posted here is not a recursive data source. There is no Children property on your Patient object. I also don't see anything in this sample that would allow me to add a row to the grid, the datasource or any child data.
Did you post the wrong sample?
My guess is that your Children property was returning Null instead of an empty collection - that would explain why you can't add child rows. But that's just a guess.
Hi Mike,Sorry for the goof up. I attached the sample again. Your guess is somewhat right initially the Children property will have null value. But before adding an object to children collection I am initializing it and adding it. Wouldn't that return the collection? Please refer the sample. Thanks