PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Weird BindingList - BindingSource problem: Add(New)/Insert/... not called
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Weird BindingList - BindingSource problem: Add(New)/Insert/... not called
![]() |
Weird BindingList - BindingSource problem: Add(New)/Insert/... not called |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi,
I have a custom List that inherits from BindingList. It has some methods overloaded, like the Add/Insert/etc to add and remove some eventhandlers when adding or removing an item T of the list. The problem happens when: - I use such a BindingList as DataSource for a BindingSource. - Add this BindingSource as DataSource for a DataGridView. - And go to the NewRow and add a new row in the DataGridView. None of the overloaded Add/AddNew/AddNewCore/Insert/InsertAt of my BindingList are called! So the eventhandlers aren't added to the newly added object neither. But when I look at my BindingList, it has an Item added... So somehow this Item is added to the BindingList, but not via the 'normal' ways? How does this come, and how to avoid this? I just don't get it that a new Object is added, without using the overloaded functions of my BindingList?? Anybody has any idea? And a solution? Any help will be really appreciated! Thanks a lot in advance, Pieter |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Ok nevermind: I had to shadow the methods, and it was the Protected
Overrides Sub InsertItem-method that was called... "Pieter" <pietercoucke@hotmail.com> wrote in message news:eNsIQFhWGHA.4452@TK2MSFTNGP04.phx.gbl... > Hi, > > I have a custom List that inherits from BindingList. > It has some methods overloaded, like the Add/Insert/etc to add and remove > some eventhandlers when adding or removing an item T of the list. > > The problem happens when: > - I use such a BindingList as DataSource for a BindingSource. > - Add this BindingSource as DataSource for a DataGridView. > - And go to the NewRow and add a new row in the DataGridView. > > None of the overloaded Add/AddNew/AddNewCore/Insert/InsertAt of my > BindingList are called! So the eventhandlers aren't added to the newly > added object neither. But when I look at my BindingList, it has an Item > added... So somehow this Item is added to the BindingList, but not via the > 'normal' ways? > > How does this come, and how to avoid this? I just don't get it that a new > Object is added, without using the overloaded functions of my > BindingList?? > > Anybody has any idea? And a solution? > > Any help will be really appreciated! > Thanks a lot in advance, > > Pieter > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

