StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
Binding BOs to EnhancedList with Parent-Child relationship.
Binding BOs to EnhancedList with Parent-Child relationship.
Post Reply
Like
1
Binding BOs to EnhancedList with Parent-Child relationship.
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Lukasz Kustusz
Lukasz Kustusz
posted 15 Years Ago
ANSWER
HOT
Topic Details
Share Topic
Group: Forum Members
Posts: 29,
Visits: 125
Hello,
I'm quite new to Strataframe Framework. I installed the trial version just yesterday. I'm working on a log viewer project that would represent log records from the DB using the DevExpress gridview (which is the EnhancedList wrapper from the SF).
The way my DB tables are structured are quite simple. I have three different logs that I'd like to represent in my grid. I have a MasterTable with PK = Rec_ID and LogType_ID, and I have 6 other tables, one for each log type. The MasterTable contains fields common to all logs, like time, user, etc. Each log table also has a Rec_ID, and LogType_ID. I also have a LogTypeDescription table with two fields (LogType_ID, LogDescription) with 6 records in it, each describing different log type.
I've created my BOs, one for each of the tables defined above, and I defined relationdhips between them using ParentRelationship property. Relationships are simple: MasterTable is the parent to all other tables, linking on the Rec_ID, LogType_ID.
I'd like to be able to see those relationships represented in the grid using its Master-detail view, where master records would be expandable showing a different view depending on the type of log.
I was able to bind my MasterTable to the grid (Using BusinessBindingSource bound to the Mastertable), but the relationships are not detected. I've already done something similar using embedded ADO.NET dataset, and it works fine, but I'd like to se if strataframe can do similar tricks. Form the DevExpress documentation I know that in order for the Master-Detail view to work I have to Master-Detail: DataTable specific names for the TableAdapters, ie. AdapterTable1, AdapterTable2 etc (This is in
Windows Forms Components
>
Products
>
XtraGrid
>
Concepts
>
Master-Detail Overview
>
Binding to Data Specifics
>
Master-Detail: DataTable Use
of the DevExpress documentation)
-> How can I do this with EnhancedList and BOs?
-> Do I have to use BusinessBindingSource, and if not how should I set up the binding?
-> How can I specify that the LogType_ID from every BO be "replaced by" LogDescription from the LogTypeDescription BO?
-> Is there a way for a BO to represent a join of two tables?
Thanks,
Lukasz
Reply
Like
1
Reply
Lukasz Kustusz
Lukasz Kustusz
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 29,
Visits: 125
Thank you for your comment. I tried it but it doesn't work exactly as expected. I added an unbound column to the parent view and populate it in the CustomColumnDisplayText like so:
Private Sub GridView2_CustomColumnDisplayText(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs) Handles GridView2.CustomColumnDisplayText
If GridView2.RowCount = 0 Then
Exit Sub
End If
If e.Column.FieldName = "Type" Then
BoMasterLogType1.SeekToPrimaryKey(e.Value)
End If
If BoMasterLogType1.CurrentRowIndex >= 0 AndAlso e.Column.FieldName = "colTypeDescription" Then
e.DisplayText = BoMasterLogType1.Type_Description
End If
End Sub
I call the FillAll method of
BoMasterLogType1 in Form_Load.
It seems to work as far as the display is concerned, ie every row now has the correct LogDescription in the custom column. But it's not working when I drag the LogDescription column to the Group by section. It only shows one log type at a time - the one that's in the curernt row. Grouping by any of the bound columns works fine, ie. all possible values are shown.
Forgive my ignorance, but shouldn't this linking be done in the Buisness or even Data tier? Is it not possible to link two BOs to produce this effect (like a BO join)? If I wanted to replace grid by a form with text boxes, and I wanted to show the description field instead of ID for any given type or category of a BO, do I have to handle it in the interface like this every time?
Reply
Like
1
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
Binding BOs to EnhancedList with Parent-Child relationship.
Lukasz Kustusz
-
15 Years Ago
Hi Lukasz. Take a look at the posts from here, they can help you:...
Ivan George Borges
-
15 Years Ago
Thank you for your answer. Unfortunatelly I don't see how this applies...
Lukasz Kustusz
-
15 Years Ago
Thanks for your interest in StrataFrame. As you well know, there are a...
Trent L. Taylor
-
15 Years Ago
Thank you, Trent. I do see your point, to avoid grid-central design,...
Lukasz Kustusz
-
15 Years Ago
Hi Lukasz. I went ahead and downloaded DevEx to create a quick sample...
Ivan George Borges
-
15 Years Ago
Thank you very much for the sample, I'm eager to try it out. I imagine...
Lukasz Kustusz
-
15 Years Ago
It uses the StrataFrame Sample database that is installed with the SF...
Ivan George Borges
-
15 Years Ago
Thank you again for all your support. I've rebuilt my project...
Lukasz Kustusz
-
15 Years Ago
You are welcome, Lukasz. To accomplish what you asked, I would add an...
Ivan George Borges
-
15 Years Ago
Thank you for your comment. I tried it but it doesn't work exactly as...
Lukasz Kustusz
-
15 Years Ago
See previous post
Lukasz Kustusz
-
15 Years Ago
That is the way I usually go. On the grid, you probably need an event...
Ivan George Borges
-
15 Years Ago
Thanks Ivan, I finally solved the issue with some support from the...
Lukasz Kustusz
-
15 Years Ago
As Trent has written to you before, StrataFrame covers many different...
Ivan George Borges
-
15 Years Ago
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