Return value from childform


Author
Message
kkchan
kkchan
StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)
Group: Forum Members
Posts: 48, Visits: 97
Hi,

How could I return value from childform?



I have code as below. But, .NET unable to detect my property RegionID defined in my child form.





private void lnkRegion_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)

{

if (this.childFormDialog.ShowDialog() == DialogResult.OK)

{

this.cboRegion.Requery();

//this.cboRegion.SelectedValue = this.childFormDialog.childForm.RegionID;

}



}




Thank you
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
If you are using a ChildFormDialog then only a DialogResult is returned.  Generally there is no reason to have a return value since in most cases, one or more BOs are shared between the child form and the calling form.  So all proper action can be taken on the child form.

If you want to return a value then call the child form manually and create a property to test on within the child form.  This is really the only way to "return" a value.

kkchan
kkchan
StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)
Group: Forum Members
Posts: 48, Visits: 97
Once again, BOTranslation! w00t
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