Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 566573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:59:31+00:00 2026-05-13T12:59:31+00:00

The ListChanged event for an IBindingList fires a type ListChangedType.ItemDeleted when items are deleted,

  • 0

The ListChanged event for an IBindingList fires a type ListChangedType.ItemDeleted when items are deleted, perhaps by a user deleting a row in a datagrid control bound to the list. The problem is that the NewIndex into the list is invalid in this event, it’s been deleted, and the item that was deleted is not available. There should be an ItemDeleting event, but I doubt they will ever fix this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:59:31+00:00Added an answer on May 13, 2026 at 12:59 pm

    Yeah it’s pretty annoying, but there is an easy workaround. I create a BindingListBase<T> class that I use for all of my lists instead of using a normal BindingList<T>. Because my class inherits from the BindingList<T>, I have access to all of it’s protected members, including the RemovedItem method.

    This enables me to pick up when an item is removed. You could do what I do and have a mRemovedItems list that I always add items to, or raise your own ‘ItemRemoved’ event.

    See my code example below:

    Public MustInherit Class BindingListBase(Of T)
        Inherits BindingList(Of T)
    
        Protected mRemovedItems As New List(Of T)
    
        Protected Overrides Sub ClearItems()
            MyBase.ClearItems()
            mRemovedItems.Clear()
        End Sub
    
        Protected Overrides Sub RemoveItem(ByVal index As Integer)
            Dim item As T = MyBase.Item(index)
    
            MyBase.RemoveItem(index)
    
            mRemovedItems.Add(item)
        End Sub
    
        Public ReadOnly Property RemovedItems as List(Of T)
            Get
                Return mRemovedItems
            End Get
        End Property
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a BindingList of type User, the User object has several properties (UserName,
We have a passwords table which references a user table. Records never get deleted
I have a custom IBinding List which raises the ListChanged event. I would like
When an item is added to the BindingList, the ListChange event lets me know
I want to bind Repeater control to Dataset which is filled with XML data,
I'm a newbie in events. This example shows that an event is invoked every
SELECT snore_notification.id, snore_notification.acknowledged, snore_notification.active, snore_notification.classname, snore_notification.elementclass, snore_notification.elementname, snore_notification.event, snore_notification.eventtext, snore_notification.firstnotified, snore_notification.lastnotified, snore_notification.lastcleared, snore_notification.lastchanged, snore_notification.inserttime,
System.InvalidCastException was unhandled Message=Unable to cast object of type 'SportSoft.SSBLL.CMembershipTypeAdvanceBooking' to type 'SportSoft.SSBLL.CAreaActivities'. Source=SSDlgs
I have a BindingList(T) that I am displaying in a DataGrid . I'm watching
I am able to get the index of items added to the BindingList. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.