Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Data Binding / September 2006

Tip: Looking for answers? Try searching our database.

Behavior of IBindingList's EndNew and CancelNew

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sam Carleton - 11 Sep 2006 13:44 GMT
Hay Microsoft,  I am trying to implement an advanced BindingList, one
that supports adding and deleted rows while filtered.  I am having a
bear of a time making heads or tails of the rules for when EndNew() and
CancelNew() are called. I have gone ahead and written a test program to
see when they get called.  Here is what I am seeing:

the DataGridView starts with two lines and neither function has been
called.  As soon as I click on the new row, I get this:

EndNew(0)
EndNew(0)
AddNewCore()
InsertItem(2, )
EndNew(-1)
EndNew(0)

When I click on the second row (cancel the add) I get this:

CancelNew(2)
RemoveItem(2)
EndNew(2)

If I where to make changes and then click on the second row, to commit
the changes I get this:

EndNew(2)
EndNew(2)

My best guess is that the EndNew() should be ignored unless the index
is that of the last InsertItem().  My real question is:

Microsoft is there any offical documentation out there regarding what
the behavior is on this?

Sam Carleton
Bart Mermuys - 17 Sep 2006 20:11 GMT
Hi,

> Hay Microsoft,  I am trying to implement an advanced BindingList, one
> that supports adding and deleted rows while filtered.  I am having a
[quoted text clipped - 29 lines]
> Microsoft is there any offical documentation out there regarding what
> the behavior is on this?

I guess it's also called on EndEdit and CancelEdit, but according to Net.
SDK Doc, you should compare the index with the last (pending) added index
(AddNew) like you mentioned.

see
http://msdn2.microsoft.com/en-us/library/system.componentmodel.icanceladdnew.aspx

---
HTH,
Greetings

> Sam Carleton

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.