Grandchild Listview


Author
Message
Mike Tomlin
Mike Tomlin
StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)
Group: StrataFrame Users
Posts: 23, Visits: 5.8K
I have a child form opened from a listview using the automation features - all works fine. On that child form I have another listview which again opens a form - this form opens and closes OK but I cannot add a new record to the list - it's missing the primary key. If I manually add records to the table they display OK and I can edit them. I think the parent-child relationships are set OK on the BO's.

Does the basic listview automation work when called from a child form or do I need to handle this differently?

Thanks

Reply
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Mike Tomlin (05/12/2009)
...do I need to help the automation in this case?




Yes, the ListView has an event named "ChildFormResults" which you use to make the automation feature to requery the listview. Here is a sample code from one of my listview:





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





Also keep in mind that when you delete a record, it may be marked as Deleted only and in that case it will require you to Save() the BO to actually delete the record, there is a property in the listview which controls this feature.



The StrataFlix sample application has several listview used which demonstrate this approach.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search