All translations take place at the time of the Load event. All code references are updated, however, there are times that you need to manually update the object instance references and this may be one of them. We do not reflect through all of the objects on the form as this would be very slow using reflection. So if you override the OnLoad method of the form and manually update the reference on the list, it may resolve your issue.
VB.NET
C#
Private Sub ListView1_ChildFormResults(ByVal sender As System.Object, ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.ListViewChildFormResultsEventArgs) Handles ListView1.ChildFormResults
If e.Results = Windows.Forms.DialogResult.OK Then'-- Save the BOMe.Trans_failure_item_BO1.Save()ElseMe.Trans_failure_item_BO1.RestoreCurrentDataTableSnapshot(False)End If'-- Force the listview to requeryMe.ListView1.Requery(CInt(Me.Trans_route_Master_BO1.CurrentRow.Item("route_pk_id")))End Sub
the listview is filled by the parent primary key and this should force it to requery - it must be working after an add or edit as the display is fine - just the delete goes blank.
Private Sub lstTransactionItems_ChildFormResults(ByVal sender As System.Object, ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.ListViewChildFormResultsEventArgs) Handles lstTransactionItems.ChildFormResults If e.Results = Windows.Forms.DialogResult.Cancel Then Me.BizTransactionItems1.RestoreCurrentDataTableSnapshot(False) Else e.Requery = True End If End Sub
The only issue I have left is that if I delete, again using the automation, on deletion the list box is clearing and showing no records. The deletion has happened OK but probably something's amiss with the requerying - do I need to help the automation in this case?
Does the basic listview automation work when called from a child form or do I need to handle this differently?
Thanks