Re: Difference in CurrencyManager from 1.1 to 2.0 when calling AddNew

Greg Robinson <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Message-ID <[email protected]>
The call to AddNew on BindingContext is not creating the new row (I assume
it's silently failing), so when our code tries to access the current row we
get an exception.

This worked fine in 1.1 but is not working in 2.0.




Greg Robinson
Custom Data Systems, Inc.
www.cds-am.net

-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps
and controls [mailto:[email protected]]On Behalf Of
Greg Robinson
Sent: Thursday, May 03, 2007 12:02 PM
To: [email protected]
Subject: [DOTNET-WINFORMS] Difference in CurrencyManager from 1.1 to 2.0
when calling AddNew


We have code that does this:

Me.BindingContext(Me.ModuleDataSet, "names.NamesHomeAddrRelation").AddNew()
Dim managerChild As CurrencyManager =
DirectCast(Me.BindingContext(Me.ModuleDataSet,
"names.NamesHomeAddrRelation"), CurrencyManager)
Dim drvChild As DataRowView = DirectCast(managerChild.Current, DataRowView)

In 1.1 managerChild's Count is 1:

?managerchild
{System.Windows.Forms.RelatedCurrencyManager}
    [System.Windows.Forms.RelatedCurrencyManager]:
{System.Windows.Forms.RelatedCurrencyManager}
    Bindings: {System.Windows.Forms.ListManagerBindingsCollection}
    Count: 1
    Current: {System.Data.DataRowView}
    List: {System.Data.RelatedView}
    Position: 0

In 2.0 it is 0:

?managerChild
{System.Windows.Forms.RelatedCurrencyManager}
    System.Windows.Forms.RelatedCurrencyManager:
{System.Windows.Forms.RelatedCurrencyManager}
    Bindings: {System.Windows.Forms.ListManagerBindingsCollection}
    Count: 0
    Current: {"Index -1 does not have a value."}
    IsBindingSuspended: True
    List: {System.Data.RelatedView}
    Position: -1



Can anyone tell me why there is a difference?



Thanks,



Greg Robinson
Custom Data Systems, Inc.
www.cds-am.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.