473,734 Members | 2,375 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 3106
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
1667
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
2982
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
5635
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
2366
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 DataGridView. - And go to the NewRow and add a new row in the DataGridView.
1
2563
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
4502
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 the ACTIVE Record update the LAST Record to make it INACTIVE when I add new Lease Records. ...
3
1556
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
3626
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 specified record" error, and no new row is created. Each of these are just supposed to add a new row in...
1
7761
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 employer to use at least 8 characters long password that contains chars and numbers. I know that there...
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9310
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4550
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.