Hierarchical data with AddNew and Add

Posts   
 
    
ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 06-Mar-2008 16:28:16   

Adapter, 2.5, C#

I have a simple self referencing table.

In code I add a new record like this:

singlePerson = MyLLBLCollection.getmeapersonfunction();

Person p = singlePerson.ItsChildren.AddNew();

The windows BindingSource that is bound to the MyLLBLCollection doesn't know about the new 'person' until I then call:

MyLLBLCollection.Add(p);

The moment I do this the BindingSource fires the Adding event and items bound to the MyLLBLCollection are updated visually.

Shouldn't AddNew() do that?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 07-Mar-2008 10:46:07   

The AddNew() has the following remark in the LLBLGen Pro reference manual

Do not call this method from your own code. This is a databinding ONLY method

ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 07-Mar-2008 12:51:05   

Thanks Walaa,

I did a search on "AddNew" in the help, but got "No Results Found". What should I search on to see that article?

Ian

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 07-Mar-2008 15:01:14   

That's in the Reference manual, not the Documentation manual.