Master and details devexpress grid wuth SF BO


Author
Message
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Hi Peter,

Glad you figured out the versioning thing Smile kinda thought it was something like that

I think all of your questions are things I have added after I posted the sample app, At first the basic idea was to be able to use the dataset class with Xtra Reports and for read-only master-Detail grids to allow a "drill down" capability. I was mainly interested in being able to have access to all the strong typed fields at design time because it makes report design alot easier and I was happy with that!

After having some issues with the business binding source I decided to try to make this dataset class stay in sync with the business objects (read-write),anyways I think I have it working for the most part but it may still be a little bit buggy I don't remember where I left off Friday but I'll try to post what I have so far  a bit later today if I can.

Paul

Peter Jones (11/02/2007)
Hi Paul,

I saw 7.2 and I thought our versions where the same but you are 7.2.2 while I'm still using 7.2.1. Anyway I can see things now and what you've done looks really good - I will certainly take a much closer look because the inbuilt Parent/Child stuff in DevExpress always seemed like a very clean UI to me. A couple of questions though:

1) When I look in the code I see only boCustomer is exposed. Could all the bo's be dropped on the form and everything would work ok?

2) In the screen shots I see the SF toolbar is on the form. Does that work ok in whatever grid view has focus?

3) I take it the general flow is the BOs are populated as normal and, within DataSetBase (very clever BTW), the relations are created (using info from the BOs) and the data loaded for use in the various grids. If this is so how do changes in DsCustomerOrders dataset make their way back into the BO's for saving to the database?

Cheers, Peter


Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Chan,

The project doesn't have the business objects that you are using in the dataset so I can't easily see what the issue is.

Are you saying the dataset does not show up on your toolbox?

Here are the steps that should make this work

Create a class that inherits from datasetbase

drop business objects on the new class

override relations if needed

Rebuild solution

should have new class in toolbox,

drag new class onto form or report from toolbox and set data source and member

Chan
Chan
Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
hi,

I have reattach another sample.



Thank you.
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
ok i'll try to take a look at it
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Paul's example and description of how to use a multi-detail band on any environment relying on the IList interface is very good.  It thought I would also share what we do.  We take a slightly different approach and this is how we create our strong-typed data sources for reporting and grids.

Let's take the report approach as this will be what I believe everyone is trying to accomplish here.  We have a reporting assembly that has a data source for each report that we create.  Our base data source inherits off of the BusinessBindingSource, we also inherit the BO we plan to use off of the primary BO so that we can add any custom fields without making a mess of the original BO.

Public Class MyReport_CustomersBO
    Inherits CustomersBO

'-- Add any custom Fill methods to retrieve data specific to the report (supports INNER JOINS, etc)

'-- Add any custom fields that may be specific to the report

End Class

Public Class MyBaseDataSource
    Inherits BusinessBindingSource

Private _ReportBO As New MyReport_CustomersBO

Public Sub New()
    '-- Attach the data source to the binding source
    Me.BusinessObject = _ReportsBO
End Sub

End Class


Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Trent,

Does that allow you to do master detail binding?

In other words

Customer-->

                  Orders-->

                                 Order Items

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Yes, you can chanin these together.  So you may have a CustomersBBS and a CustomerOrdersBBS.  Within the CustomersBBS you can create a property that exposes the CustomerOrdersBBS.  There are two hitches that you have to account for.  First, the private field that exposes the child needs to be shared and second, you have to manually filter out the child records when returning the child object.

Public Class CustomersBBS
    Inherits BusinessBindingSource

Private Shared _CustomerOrdersBBS As New CustomerOrdersBBS()

Public ReadOnly Property CustomerOrders
    Get
        '-- Filter out the child records
        _CustomerOrdersBBS.BusinessObject.Filter = "or_cust_pk=" & Me.BusinessObject.cust_pk.ToString()

        '-- Return the filtered BO
        Return _CustomerOrdersBBS
    End Get
End Property

End Class

This is what we do for all of our reporting and have some very deep and complex relationships and it has worked out great!

Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Trent,

I got really busy yesterday so wasn't able to spend much time looking at this. Is there anyway you can create a sample of how to use the BBS to create a master detail grid?

I had some issues using the BBS as a binding source that was discussed in another thread. Ben gave me some good suggestions on how to get around the issues I faced but I ended up using this approach to grid binding as it meant I did not have to refactor and then retest quite a bit of logic.

Anyways it would be great to see an sample of how it would work using a BBS.

Paul

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I will see if I can't get a sample created for the next build so that it is a bit more in-depth.  This is the approach that we use and it has worked well.
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Peter,

I got really busy yesterday so didn't have a chance to post this, this is an editable version of the data set class, basically what I am trying to do is to keep the business objects on the form in sync with the data tables in the data set. 

For the most part I think it will work ok but there still may be some gotcha's I haven't ran across. I also threw in a report so you can see how that works.

Anyways I hope this helps out anyone that is looking to do this sort of thing. 

I also am posting an infragistics 2007 volume1 version just cause it was easy enough to do Smile.

Paul

Attachments
Dev_Express.zip (169 views, 104.00 KB)
Infragistics.zip (146 views, 100.00 KB)
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