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

Replies
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
Thinking about it this is only called when the child form launched from the listview is involved. In a delete from the listview the child form is not launched.
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
The Delete should requrery your listview automatically. Also in the ChildFormResults the parameter e.Requery = True will requery the listview based on the parameters you have in the ListPopulating event. Again the StrataFlix uses the latest release of the SF and shows how to handle this with much clear code, even thought what you are doing is OK by passing the parameter to the Requery().

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Edhy is correct in that the StrataFlix shows a number of examples on this and does fully support the most recent version of SF.  Also, if you are allowing the delete to be handled automatically through the ListView, it will remove the record.  The issue that you may be fighting if the deletion is not being reflected further upstream is due to the BO translations.

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

Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
    MyBase.OnLoad(e)
    lstList.BusinessObject = MyBo
End Sub

C#

protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    lstList.BusinessObject = MyBo;
}

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