﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Finding The Parent</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 06:13:51 GMT</lastBuildDate><ttl>20</ttl><item><title>Finding The Parent</title><link>http://forum.strataframe.net/FindPost22561.aspx</link><description>Hi Guys,&lt;/P&gt;&lt;P&gt;I am using the listview, in its full automated glory. What I have is a childform that has 3 buttons on it, that are OK/Add,OK and Cancel. OK and Cancel are easy enough to deal with, but the OK/Add button&amp;nbsp;keeps the child form open so that the user can add another item and for the parent form to update and show the line that was added. The idea is to just reduce mouseclicks.&lt;/P&gt;&lt;P&gt;Now, I had previously done this using the parentform capability, but when using the childformdialog this seems to be empty.&lt;/P&gt;&lt;P&gt;What is best way of finding out the parent form that a childform was launched from is this held anywhere?&lt;/P&gt;&lt;P&gt;Also, how do you pass in parameters to a childform when using the automated listview? I can't see this being done in strataflix, but I might have missed it. Indeed, this&amp;nbsp;could resolve my first problem.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Geoff.</description><pubDate>Wed, 01 Apr 2009 07:14:27 GMT</pubDate><dc:creator>Geoff Hirst</dc:creator></item><item><title>RE: Finding The Parent</title><link>http://forum.strataframe.net/FindPost22584.aspx</link><description>No problem :)</description><pubDate>Wed, 01 Apr 2009 07:14:27 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Finding The Parent</title><link>http://forum.strataframe.net/FindPost22582.aspx</link><description>Trent,&lt;/P&gt;&lt;P&gt;Sorry, missed the shared (most important bit).&lt;/P&gt;&lt;P&gt;best&lt;/P&gt;&lt;P&gt;Geoff.</description><pubDate>Wed, 01 Apr 2009 06:06:05 GMT</pubDate><dc:creator>Geoff Hirst</dc:creator></item><item><title>RE: Finding The Parent</title><link>http://forum.strataframe.net/FindPost22581.aspx</link><description>Hi Trent,&lt;/P&gt;&lt;P&gt;THanks for this. &lt;/P&gt;&lt;P&gt;If you are using the Listview automation, how do you get to be able to access this property? The form is wrapped up in the ChildFormDialog object, which doesn't have any events. The Listview has the BeforeChildFormExecuted, but again I can't find anyway to access the actual form.&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;Geoff.</description><pubDate>Wed, 01 Apr 2009 06:04:52 GMT</pubDate><dc:creator>Geoff Hirst</dc:creator></item><item><title>RE: Finding The Parent</title><link>http://forum.strataframe.net/FindPost22575.aspx</link><description>I have actually wanted to do this before and I jsut haven't done it....primarily because you can get around it pretty easy.&amp;nbsp; I just created a shared (static) property that was exposed on the child form which is a reference to the parent form.&lt;/P&gt;&lt;P&gt;[codesnippet]Private Shared _MyParentForm As Form&lt;BR&gt;Public Shared Property MyParentForm As Form&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return _MyParentForm&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _MyParentForm = value&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Set&lt;BR&gt;End Property[/codesnippet]</description><pubDate>Tue, 31 Mar 2009 21:27:14 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Finding The Parent</title><link>http://forum.strataframe.net/FindPost22567.aspx</link><description>Ah, I see. Because the ListView itself handles opening the ChildFormDialog, you don't have an easy way to requery the list (I think that is what's going on).&lt;br&gt;
&lt;br&gt;
I think the first thing I'd try is to just handle an event on the BO, like the AfterSave event.  Since you are likely passing this through to the ChildFormDialog, you could just requery whenever the child BO is saved.</description><pubDate>Tue, 31 Mar 2009 12:57:33 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Finding The Parent</title><link>http://forum.strataframe.net/FindPost22564.aspx</link><description>Sorry Edhy,&lt;/P&gt;&lt;P&gt;I may not have explained this very well.&lt;/P&gt;&lt;P&gt;What I want to see is that if my user clicks OK/Add, for the listview that is on the parent form 'behind' my childform, updating with the record I just added.&lt;/P&gt;&lt;P&gt;If I can get a reference in the childform of the parentform, I can call a simple listview requery, but I can't seem to do this. If I could pass through parameters, I could just pass thru a reference to the form, that would enable me to do the above.&lt;/P&gt;&lt;P&gt;I have tried to accomplish this using different dialogresults, such as ignore or none. dialogresult.Ignore makes the child form close, which I don't want, and&amp;nbsp;&amp;nbsp; dialogresult.none doesn't update the listview on the parent.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Geoff</description><pubDate>Tue, 31 Mar 2009 11:57:11 GMT</pubDate><dc:creator>Geoff Hirst</dc:creator></item><item><title>RE: Finding The Parent</title><link>http://forum.strataframe.net/FindPost22562.aspx</link><description>Hi Geoff,&lt;br&gt;
I don't quite understand what is the problem here.  I know your OK/Add button will add another record to the childBO and let the childform opened so this new record can be edited, right? if so what is the problem you are facing?&lt;br&gt;
Also it would be helpful if you post the code in your OK/Add button.&lt;br&gt;
&lt;br&gt;
About the parameter, I don't thing it is supported, but if you need to access the parent BO, simply add it to the childform and in the parent form's childformdialog add a translation to the parent BO as you did with the child BO.</description><pubDate>Tue, 31 Mar 2009 09:13:27 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>