Master and details devexpress grid wuth SF BO


Author
Message
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

Any sample code to show how to have master and details BOs shown in XtraGrid (in same grid)?



Thank you
Replies
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

Thank you for sample.

I have tried it, but VS keep complaining it is not typed dataset. (I attached the code)

I also tried to add your sample project to my solution, and add to my form (difference project). VS unable to locate the sample dataset while trying to add item to toolbox.



Any ideas?



Thank you
Paul Chase
Paul Chase
Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 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 (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
hi,

I have reattach another sample.



Thank you.
Paul Chase
Paul Chase
Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 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 (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
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 (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 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 (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
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 (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 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 (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 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 (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 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 (232 views, 104.00 KB)
Infragistics.zip (212 views, 100.00 KB)
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

After created BBS, how to set it to xtragrid to show master details?



Thank you
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

I finally able to make xtragrid recognize my dataset and relations of my dataset. However, when I set datamember of gridview, it prompted error 'child list can not be created'



Any ideas?



Thank you
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
Is there an InnerException to that exception?  It might give you more info as to why it was unable to create the list.
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Ben Chase (11/08/2007)
Is there an InnerException to that exception? It might give you more info as to why it was unable to create the list.




Hi,

I still failed to configure xtragrid to show "+" sign using BBS as suggested. What should I set so that xtragrid grid know it is master and details?



In my previous post, I mentioned IO able to configure xtragrid, is using DataSetBase provided by Paul Chase. Sorry for confusing.
Paul Chase
Paul Chase
Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Chan the inner exception still would be helpful to see what is going on, I never had any errors like the the one you describe so am not sure what would cause it

I know you converted the code I did into C# so maybe something got messed up in the conversion?

The samples you sent earlier are not very helpful to me, can you try to replicate the project I created in VB using the strataframe sample database?

Paul

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Chan - 18 Years Ago
StrataFrame Team - 18 Years Ago
Paul Chase - 18 Years Ago
Robin J Giltner - 18 Years Ago
Paul Chase - 18 Years Ago
Chan - 18 Years Ago
Paul Chase - 18 Years Ago
                     hi,
I have reattach another sample.

Thank you.
Chan - 18 Years Ago
                         ok i'll try to take a look at it
Paul Chase - 18 Years Ago
                             Paul's example and description of how to use a multi-detail band on...
Trent L. Taylor - 18 Years Ago
                                 Trent, Does that allow you to do master detail binding? In other...
Paul Chase - 18 Years Ago
                                     Yes, you can chanin these together. So you may have a CustomersBBS and...
Trent L. Taylor - 18 Years Ago
                                         Trent, I got really busy yesterday so wasn't able to spend much time...
Paul Chase - 18 Years Ago
                                             I will see if I can't get a sample created for the next build so that...
Trent L. Taylor - 18 Years Ago
                                             Peter, I got really busy yesterdayso didn't have a chance to post...
Paul Chase - 18 Years Ago
                                         Hi,
After created BBS, how to set it to xtragrid to show master...
Chan - 18 Years Ago
                             Hi,
I finally able to make xtragrid recognize my dataset and...
Chan - 18 Years Ago
                                 Is there an InnerException to that exception? It might give you more...
StrataFrame Team - 18 Years Ago
                                     [quote][b]Ben Chase (11/08/2007)[/b][hr]Is there an InnerException to...
Chan - 18 Years Ago
                                         Chan the inner exception still would be helpful to see what is going...
Paul Chase - 18 Years Ago
Peter Jones - 18 Years Ago
Paul Chase - 18 Years Ago
Peter Jones - 18 Years Ago
Peter Jones - 18 Years Ago
Paul Chase - 18 Years Ago
Richard Keller - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Richard Keller - 18 Years Ago
Trent L. Taylor - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search