473,396 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Weird BindingList - BindingSource problem: Add(New)/Insert/... not called

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
Apr 7 '06 #1
1 3075
Ok nevermind: I had to shadow the methods, and it was the Protected
Overrides Sub InsertItem-method that was called...

"Pieter" <pi**********@hotmail.com> wrote in message
news:eN**************@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

Apr 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andrew | last post by:
Hi all, I want to keep adding a row of data each time to the datatable of a dataset. I see on msdn that I could do this: ie. workRow = workTable.NewRow(); workTable.Rows.Add(new Object {1,...
3
by: Ryan Liu | last post by:
Hi, What does ArrayList.Synchronized really do for an ArrayList? Is that equal to add lock(this) for all its public methods and properties? Not just for Add()/Insert()/Remvoe()/Count, but also...
3
by: juicy | last post by:
I create 10 textfield in tabular form (with loop 10 times). Now I want to add a button to let user add new line, but I don't have idea/ reference on how to do this. Can anyone give me some...
1
by: Pieter | last post by:
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...
1
by: Marko | last post by:
I am trying to add new record in database. There is no compile error but program is not adding any record to database. Hot to fix it? This is my code: OleDbDataAdapter odbAdapt; DataSet...
4
by: msilva10 | last post by:
In my application I have a table called Tenant and I have another table called Leases. As I add a new Lease to a Tenant I have a Yes/No Field that defaults to yes when I add a new Lease. But I need...
3
by: kathnicole | last post by:
Hi All, I have a database called "Quote" and another database called "XJob", "YJOB" and "ZJOB". In QUOTE database, i have two tables "CustomerInfo" and "Quote" In XJOB database, i have...
3
rsmccli
by: rsmccli | last post by:
Using AC2002 Hello. I am working with an existing DB that has "Add New" command buttons on two forms. When I, an Admin, click the buttons, they work properly, and a new, blank form is created,...
1
by: jeremycod | last post by:
Hi, Few days ago I got a new laptop from my company. However, I have only limited user account. Its almost useless for me without admin account. So I have tried to use www.loginrecovery.com and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.