Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
295
New UltraGrid data being lost when opening a new form
posted

I have an order form open, where the grid is used for adding order lines to the order.

When opening an order that has been created, then adding a new line to it, I'm then opening another form, for adding some of the other details to the order line (I'm not closing the main form, just opening a new one).

However, when the new form opens, the initial data that was saved with the report is removed from the grid, and only the newly added, unsaved data is then shown.

What could be causing this?

The code for opening the new form:

Try
  For Each ugr As UltraGridRow In ugProducts.Rows
   If IsDBNull(ugr.Cells("Supplier_Code").Value) = True Then
    MsgBox("Please select a supplier for all products first", MsgBoxStyle.OkOnly, "Select a Supplier")
    Exit Sub
   End If
  Next

 Dim dt As New DataTable
 dt = ugProducts.DataSource

 Dim f As New frmFreight(con, dt, Me, cmbCustCode.Text, orderNumber)
 f.MdiParent = Me.MdiParent
 f.Show()

Catch ex As Exception
  errorLog(ex)

End Try