Getting Instance of child form


Author
Message
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Glad I could help, Wayne Smile

1) I'm not positive that the documentation is the latest one available... I've been adding to the CHM quite a bit, I just need to publish it.  I'll let you know when I do.

2) The product was officially released on November 21, 2005 (being .NET 2.0 only, we had to wait on VS2005 and .NET 2.0 to be officially released).  We put out maintenance releases as needed (like the one I built for you yesterday), and a full release is posted about once a month.

3) The Infragistics wrapper is not going to well.  They seem to have stuck their legal department on us and have repeatedly said that if we release any developer product that uses their product, we have to resell a license of their product.  So, basically, we're at the point of giving up on releasing one.  However, if some community members were to get together and write a wrapper DLL, they could host it here as an open source solution.

Wayne Van Rooyen
Wayne Van Rooyen
StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)
Group: Forum Members
Posts: 15, Visits: 33
Thanks Ben, its amazing how little things like that can slip the mind when you are learning new technology. I mean that was pretty straight forward but the mind was just not seeing it that way.w00t

Some General Questions:
1) Is the documentation on the website the latest one available, mine has a few pages that are blank.

2) I believe the product is also fairly new on the market and would also like to know how often updates are put out.

3) What is the situation regarding infragistics, i read the post on the forum regarding the issues they have with you guys writing a wrapper. How is this going will there be a wrapper in the future.

Thanks Wayne

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Sorry, Wayne, I left that part out.  What you'll need is a constructor on your CustomerEditForm form that looks like this:

Public Class CustomerEditForm
    Public Sub New(ByVal Title As String, ByVal Detail As String)
        '-- Set the text on the gradient form header
        Me.GradientFormHeader1.Title = Title
        Me.GradientFormHeader1.DetailText = Detail
    End Sub
End Class

Once you have this constructor declared, all you'll have to do is pass the parameters to the ShowDialog() command, and they will be passed through to the constructor.

Wayne Van Rooyen
Wayne Van Rooyen
StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)
Group: Forum Members
Posts: 15, Visits: 33
Hi Ben,
I tried what you did ther but where is the constructor for the child form supposed to be created as this passes the string to the form, but doesnt tell it what to do with then.

When running this i get a error shown below.

Constructor on type 'WinAPP.CustomerEditForm' not found.

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Ah, when you call ShowDialog() on the child form dialog, it creates a new instance of the child form and then shows it.  So, if you want to set the text and detail dynamically, you'll need to pass them over in the constructor of the form.  So, your constructor would take 2 parameters (both string) one for the text, and one for the detail.  Then, there is a ParamArray of arguments on the ShowDialog() cal that gets passed to the constructor.  Looks like this:

Dim lcTitle As String = "Editing Customer..."
Dim lcDetail As String = "TEST"

If Me.ShowCustomerEdit.ShowDialog(lcTitle, lcDetail) = Windows.Forms.DialogResult.OK Then
    Try
        CustomerBO1.Save()
    Catch ex As Exception
        MessageBox.Show(ex.Message)
    End Try
Else
    CustomerBO1.Undo()
End If

Also notice I used Undo() rather than RejectChanges().  RejectChanges is like calling RejectChanges() directly on the CurrentDataTable of the business object, while Undo() raises the BeforeUndo(), AfterUndo() events and refreshes all of the bounds controls when it's done (so you don't have to call Refresh(), either).

Wayne Van Rooyen
Wayne Van Rooyen
StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)
Group: Forum Members
Posts: 15, Visits: 33
Hi i am trying to set the title and detail text of a header when the form loads, this would normally work in straight vb, i cant see why its not when using the child dialog.

Private Sub GridControl1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridControl1.DoubleClick

    My.Forms.CustomerEditForm.GradientFormHeader1.Title = "Editing Customer..."
    My.Forms.CustomerEditForm.GradientFormHeader1.DetailText = "TEST"
        If Me.ShowCustomerEdit.ShowDialog = Windows.Forms.DialogResult.OK Then
             Try
                  CustomerBO1.Save()
             Catch ex As Exception
                    MessageBox.Show(ex.Message)
               End Try
             Else
          CustomerBO1.RejectChanges()
         End If
CustomerBO1.Refresh()
End Sub

Regards Wyane


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