Master-Detail grid bound to a BO


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I would like to use a master-detail grid view for my DevExpress grid, but still use a BO or a BusinessBindingSource for the DataSource.  How do I setup the Master/Detail relationship in the BO so that it works in the grid correctly?  It has to know somehow which fields to use in the master view and which in the detail.
Replies
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Yep, here's what I ended up having to do to get it working:

Dim ds As New DataSet
Me.CalcClientBO.FillAll()
Me.ClientInfoBO.FillAll()

ds.Tables.Add(CalcClientBO.CurrentDataTable)
ds.Tables.Add(ClientInfoBO.CurrentDataTable)
ds.Relations.Add(
"ListRelation", ds.Tables(0).Columns("ClientKey"), ds.Tables(1).Columns("ClientKey"), False)

grdList.DataSource = ds.Tables(0)
grdList.LevelTree.Nodes.Add(
"ListRelation", gvListDtl)
grdList.RefreshDataSource()

It would be a lot easier if somehow the ParentRelationship set on the Parent/Child BO's could somehow create this relationship for you, so that you could still just set the BusinessBindingSource or the CurrentDataTable of the BO to the DataSource.

 


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
The problem with the BOs being able to do this automatically, is that the DataTables have to belong to a DataSet in order to define the relationships on them.
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