[Mono-bugs] [Bug 527277] New: DataView is returning a wrong Count value with a AddNew()/DataRowView.EndEdit () cycle

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jul 31 16:51:38 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=527277


           Summary: DataView is returning a wrong Count value with a
                    AddNew()/DataRowView.EndEdit () cycle
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Data
        AssignedTo: bnc-blr-team-mono at forge.provo.novell.com
        ReportedBy: calberto.cortez at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=309757)
 --> (http://bugzilla.novell.com/attachment.cgi?id=309757)
Test case

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.9.0.10)
Gecko/2009042700 SUSE/3.0.10-1.1.1 Firefox/3.0.10

It's possible to add a row to a view, and then discard it or accept that row,
using DataView.AddNew () and then DataRowView.EndEdit () on the new added row. 

When DataView.AddNew () is called, the data view is firing a ListChanged event,
and calling DataRowView.EndInit () is firing the same event with the same
members (ListChangedTypew to ItemAdded, NewIndex to the position of the new
row), which is fine.

But in the second time the event is fired (when DataRowView.EndInit is called),
the DataView.Count value reported is wrong - specifically Count+1. But this
invalid value is happening only during the time of the event, since posterior
checks return the right value.

The attached sample prints in .net: (the same Count)

ListChanged = ItemAdded, New Index = 1, Old = -1, Count = 2
ListChanged = ItemAdded, New Index = 1, Old = -1, Count = 2

In Mono we get: (the value in the second time is wrong)

ListChanged = ItemAdded, New Index = 1, Old = -1, Count = 2
ListChanged = ItemAdded, New Index = 1, Old = -1, Count = 3



Reproducible: Always

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list