StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
Why does Childformdialog not work correctly
Why does Childformdialog not work correctly
Post Reply
Like
1
Why does Childformdialog not work correctly
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Trent Taylor
Trent Taylor
posted 9 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
Glad you got it going!
Reply
Like
1
Thomas Holste
Thomas Holste
posted 9 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Users
Posts: 144,
Visits: 618
Hi Trent,
thank you for the Explanation but the error was much simpler. After adding the record I performed a sort on the BO to have the new record shown in the right Position. Resetting the sort before adding works fine.
Best regards
Thomas
Reply
Like
1
Trent Taylor
Trent Taylor
posted 9 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
Remember that the BOs are essentially just being passed over. When I am working on child dialogs, I definitely use the child form dialog so I can map my BOs, but I manage the state of the as part of the showing of the child form dialog. First, take advantage of the SaveCurrentDataTableToSnapshot method on the BO. This is better than an undo because you may go into the child form more than once as part of editing that record. The first time, things would be good, but if you go back in and cancel...well, you just toasted the record or table state. For example:
private void AddRecord()
{
myBo.SaveCurrentDataTableToSnapshot("Adding");
myBo.Add();
if(myChildForm.ShowDialog() == DialogResult.Cancel)
{
myBo.RestoreCurrentDataTableSnapshot("Adding", true);
}
}
Take this same logic and apply it to an edit. You would just replace the Add with an Edit. You can do it in the same method if you pass over the state you are expecting and the record you are wanting to load. Prior to the edit, you can do a seek to the PK or whatever if you pass it in.
Edited
9 Years Ago by
Trent L. Taylor
Reply
Like
1
Thomas Holste
Thomas Holste
posted 9 Years Ago
ANSWER
Topic Details
Share Topic
Group: StrataFrame Users
Posts: 144,
Visits: 618
Hi there,
I have a main form with a BO and a Businessbindingsource to use it with a datagridview. To add new records I call a childform with the childformdialog. This is how it's done:
LieferBO1.Add()
Dim
para
As
New
Liefneuparams
para.cNeu =
"N"
para.cModule =
"Latitelneu"
para.cLiefer =
""
para.lSolo =
False
If
Childliefneu.ShowDialog(para) = DialogResult.OK
Then .......
This works the first time I call it but the second time the liefpos.add() does not add a new record and the bo is positioned on the actual record.
Does anyone know why this is not working?
Best regards
Thomas
Reply
Like
1
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
1
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search