I have an UltraTree
I also have a BindingSource that has a List<ClassA> as it's Data source. Plan jane stuff
I call set DataBinding
tree.SetDataBinding(bsBindingSource, null);
The list has classes with collections but their all empty.
So the tree populates fine( 1 level )
On the AfterActivate event I then add an item to on of the lists' class collections ( ClassA.MyCollection.Add())
I can bsBindingSource.ResetBindings()
But the Tree View Doesnt show a 2nd level tree item.
I can add one manually, but how do I get the tree view to see the second level?
Hi,
The tree gets the data structure from the BindingManager in DotNet. My guess is that if you are using a List<T>, then the BindingManager cannot get the structure from the child band without having an actual row to work with.
Normally, what it will try to do in a case like this is add a row and then cancel that row using the IEditableObject interface. But I don't think List can support that, you would have to use BindingList and implement IEditableObject on your list items. Implementing ICancelAddNew on the BindingList instead of using IEditableObject on the items might also work, but I haven't actually tried that.
yeah I'm using BindingList.
I just assumed that If I had 5 objects that had emtpy collections and I populated a collection in object 1
I can rebind the BindingSource to the control and it would find the collection.
And I see theres column sets I can create.
Is there a way to create a columns set that says
level1 look for propertyA
level2 look for propertyB in Collection1 of the object
Just curious.
Nick