Automatically copy the data of the last row in the datagrid in to the “NewData” screen RRS feed

  • Question

  • Hi all,

    I have the following issue:

    I have a Details Screen named KlantDetail with 3 Child Tab items(See screenshot1).

    I want to do the following, when I add a new "Offerte" I want some of the last row's fields, for example the "Contactpersoon" field in the Grid to be automatically inserted into the New Data Screen(See screenshot2).

    It works when the KlantDetail screen has no Children, but when I add the 3 Tabs/children entities it doesn't work.

    Here is the code:

     Private Sub KlantDetail_Changed(e As Collections.Specialized.NotifyCollectionChangedEventArgs)

                If e.Action = Collections.Specialized.NotifyCollectionChangedAction.Add Then
                    If Me.Offerte.Count >= 1 And e.NewItems.Count = 1 Then
                            Dim newDetail As Offerte= e.NewItems(0)
                            Dim currentDetail As Offerte = Me.Offerte(e.NewStartingIndex - 1)

                            newDetail.Contactpersoon= currentDetail.Contactpersoon
                        Catch ex As Exception

                        End Try
                    End If
                End If
            End Sub

    Screenshot 1.


    Can anyone help me with this?



    Wednesday, March 19, 2014 3:59 PM