Re: IBindingList AllowNew is FALSE!!!

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Thomas Tomiczek [MVP] (t.tomiczek_at_thona-consulting.com)
Date: 11/02/04


Date: Tue, 2 Nov 2004 08:53:46 +0100

It is possible because - and now the fun starts - AddNew is called by the
binding infrastructure if the list is empty to create one intance on which
then reflection can be used to find out sub-instances.

Despite that this information should be available on an ITypedList
interface.

The added objects are then removed afterwards.

Live with it :-) It is pretty hard ,though - whoever made the databinding
architecture should be beaten.

-- 
Regards
Thomas Tomiczek
THONA Software & Consulting Ltd.
(Microsoft MVP C#/.NET)
(CTO PowerNodes Ltd.)
---
Still waiting for ObjectSpaces? Try the EntityBroker today - more versatile, 
more powerfull.
And something in use NOW. for the projects you have to deliver - NOW.
"Nathan Howard" <NathanHoward@discussions.microsoft.com> wrote in message 
news:8D24803A-62BD-4A67-8809-540B7C0A807D@microsoft.com...
> Hi Anyone,
>
> I am beyond frustrated with the .NET databinding.  I have custom business
> objects and collections for each which implement the IBindingList 
> interface
> and inherit from the CollectionBase.  Several of my business objects 
> contain
> collections of other business objects up to three or four levels deep. 
> For
> the most part they work perfectly but there is one case for which 
> everything
> goes haywire. When my objects are bound to listboxes and the collections 
> are
> empty the CurrencyManager keeps trying to call the AddNew method of the
> IBindingList interface.  I don't see how this is possible considering the
> AllowNew property is set to false on all of my objects.  I don't work in
> datagrids so have no need to implement this portion of the interface.  I 
> need
> help...
>
> Thanks in advance,
> Nathan 


Relevant Pages

  • Re: Why not multiple inheritance in C# and java
    ... "mirror" of the innards of the business objects. ... Windows control type, and that offends me. ... > You can mimic MI by delegating your interface to a class implementing the ... > IMyInterface GetMyInterface() ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Passing Business Objects through nTier Web App
    ... > sort of 'complexity budget' - where complexity in this case is measured as ... > business logic in static methods - that's too high a price to pay. ... > to have my business objects enapsulate data and behaviour, ... >>> Google Dependency Inversion Principle and Interface Segregation ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: John Resig has a new idea
    ... Your test-case has no style sheets and so the - document.styleSheets - collection will be empty in its case. ... The w3c does not define a standard "collection" interface with an item method. ... The w3c HTML DOM mentions the use of property accessors for HTMLCollection. ...
    (comp.lang.javascript)
  • Re: two complaints by Intel Fortran
    ... Intel consider two interfaces incompatible ... accepts an empty ... generic interface, but unlike ... forms that the standard doesn't allow to be empty. ...
    (comp.lang.fortran)
  • Re: Purpose of an empty Interface ??
    ... Interface, "javax.jms.ConnectionFactory". ... This interface was empty. ... This question does not apply to JAVA but to general OOP. ... There are two different schools of thought on whether empty interfaces ...
    (comp.programming)