Equivalent of VFP SET RELATION TO


Author
Message
Larry Tucker
Larry Tucker
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
I'm coming to Strataframe and .NET from Visual Foxpro and would like to set two relations for a child BO: one to the child's actual parent, and one to a lookup table for a given foreign key field on the child, something like:

OrderBO.Cust_id -> CustomerBO.Cust_id

and

OrderBO.Prod_id ->ProductBO.Prod_id

As I navigate through each Order record, I want to be able to display the related Customer.Name and Product.Title.

I've been able to successfully set the OrderBO.ParentBusinessObject = "CustomerBO" in the property sheet, but do not know how to set another relation at the same time or how to do this in code.  Any help would be much appreciated.

TIA,

Larry

Replies
Peter Denton
Peter Denton
StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)
Group: Forum Members
Posts: 77, Visits: 787
Larry,

Whether the column you are trying to display is read-only or not I still believe a lookup is the answer, the only difference being that for the read-only case you need to ensure that the lookup, however it is implemented, is set so that it disallows editing/changing.

I tried using BOs based on views when I was getting started with Strataframe, and found that it just became too complex if I needed it to be updateable. That is not to say it can't be done, and in some places is preferable, but I wouldn't use one to try and maintain a table.

My experience with Devexpress is very positive, but I have no experience with alternatives. Their support is good (though not as good as Strataframe). There are a reasonable numbers of devexpress users on this forum, and has been considerable discussion in other threads, so I suggest you do a search.

Hope this helps.

Peter

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
I would tend to agree with Peter on the lookups.  We have hundreds of places that a foreign key value needs to be selected or set.  For example, we may have a patient and their preferred pharmacy may need to be selected.  So we may populate a combo box with only the values that need to be used and bind it to the patients foreign key field.  It is always good to create a custom Fill method that only brings back the required fields in this case...no reason to add overhead:

Public Sub FillForComboDisplay()
   '-- Establish Locals
    Dim cmd As New SqlCommand("SELECT ph_pk, ph_Name FROM Pharmacies ORDER BY ph_Name")
    Me.FillDataTable(cmd)
End SUb

I would then use the FillForComboDisplay as the method to populate the combo...and the ph_pk would be the Value Member which is bound to the foreign key field.

BTW, Peter, thanks for your nice words regarding our support! 

As you may have noticed, we have a wrapper for both DevExpress and Infragistics.  Ultimately we use some of the Infragistics (after first using DevExpress) controls in our medical software.  But we have create custom controls and continue to extend our StrataFrame controls due to one isolated issue or another.  DevExpress and Infragistics are both good control companies, but we predominately use the SF controls except in areas like the UltraGrid or controls of that nature.  Infragistics also has some good masking controls (i.e. currency) but they still take some tweaking to get it just right.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Larry Tucker - 17 Years Ago
Ivan George Borges - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Larry Tucker - 17 Years Ago
Ivan George Borges - 17 Years Ago
Peter Denton - 17 Years Ago
Larry Tucker - 17 Years Ago
Larry Tucker - 17 Years Ago
Peter Denton - 17 Years Ago
Larry Tucker - 17 Years Ago
Peter Denton - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Larry Tucker - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Peter Jones - 17 Years Ago
Ger Cannoll - 17 Years Ago
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search