ListChanged Event

ListChanged Event

Old forum URL: forums.lhotka.net/forums/t/4106.aspx


culprit posted on Wednesday, January 02, 2008

Dear Forum,

I have a particular collection for which I have created a BusinessListBase. For some reason during the Update procedure the ListChanged event is being fired even though I set to false at the beginning of the procedure:

Friend Sub Update(ByVal cn As SqlConnection, ByVal parent As Object)

RaiseListChangedEvents = False

' loop through each deleted child object

For Each deletedChild As Ingredient In DeletedList

deletedChild.DeleteSelf(cn)

Next

DeletedList.Clear()

' loop through each non-deleted child object

For Each child As Ingredient In Me

If child.IsNew Then

child.Insert(cn, parent)

Else

child.Update(cn, parent)

End If

Next

RaiseListChangedEvents = True

End Sub

I do not want the ListChanged event to fire during DB update because there are some calculations being performed on this event that have already been performed when the user edits the list within the grid.

Could someone let me know what I am doing wrong or what to do to keep this event from firing during the update?

Thank You,

Rob

RockfordLhotka replied on Wednesday, January 02, 2008

This is a known issue (bug) that was fixed in 3.0.3.

culprit replied on Thursday, January 03, 2008

Thank you. Perfect.

(Can't believe I missed the availability of the book on 3 -- buying it now)

Copyright (c) Marimer LLC