473,587 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

"Pieter" <pi**********@h otmail.com> wrote in message
news:eN******** ******@TK2MSFTN GP04.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
1664
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, "Smith"}); eg. I have: DataRow row = ds.Tables.NewRow(); ds.Tables.Rows.Add(new Object {xxxxxxxxxxx});
3
2959
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 for Item (this)? Normally,do I need sync at all? Isn't that true without sync the program can run faster?
3
5631
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 useful link/ suggestion on this? Thanks.
1
3101
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 list. The problem happens when: - I use such a BindingList as DataSource for a BindingSource. - Add this BindingSource as DataSource for a...
7
6588
by: linq936 | last post by:
Hi, The following is a psudo code to describe my question: vector<int> ints; vector<int>::iterator itr; while (itr != ints.end()){ int j = some_function(*i); if (j>0){ ints.push_back(j); }
1
2556
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 dsObject= new DataSet(); DataTable dtObject; string SQL; string ConnStr; int BrojSlogova;
4
4496
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 to deactivate the Old lease record. Can anyone suggest on how I can accomplish this. Or recommend a better way to ADD a new Record that will be...
3
1550
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 similar tables "Customer" and "XJob" In YJOB database, i have similar tables "Customer" and "YJob"
3
3619
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, ready for data entry. When one of my users from the "Update Data" workgroup clicks the button, they get an "Error 2105: You can't go to the...
1
7651
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 LCP tool to find admin password, but without success, because it has strong password. I know that because our system administrator asks from each...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8205
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8339
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.