Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Exception-The list must be an IBindingList to AddNew
posted

Hi,

In our application, we have created one BindingList say aList. Whenever, users click on the checkbox in a grid, that record (defined object) gets added to this list. Suddenly without any changes to this code, whenever the list is updated for first time, say we add an item to this list, it is throwing below exception message. It adds an item to the list but still it throws the exception. For subsequent addition it does not through an exception. Similarly whenever we try to clear the list, it re-throws the exception. Any help will be appreciated. 

Let me know if you need any details.

Thanks,

Amey

Code snippet: 

private readonly BindingList<IBcd> aList; // i tried removing readonly but still issue persists

aList = new BindingList<IBcd>();

aList.add(x); // throws exception for first time 

aList.clear(); // throws exception for first time