StrataFrame Forum

Hierarchical data (UltraGrid)

http://forum.strataframe.net/Topic9031.aspx

By Tim Dol - 5/24/2007

In one of the forum posts back on February, Trent mentioned that you guys planned to release a sample  showing how to create children bands within the Infragistics Ultragrid using the SF BOs. 

I am currently rewriting our CRM product using SF and require this ability on 12 grids.  Our current CRM uses LLBLGen for data access and the hierarchical data structure is already built into the business object class.  I can't seem to figure out how to make this work using the SF BO's.  An example would be very helpful or even some direction on how to make it work would help as well.

Thanks

Tim

By Tim Dol - 5/29/2007

Just wondering if I can get confirmation on this issue. I still can't get this to work and want to know if it's possible, and if so, how to make it work.

Thanks

Tim

By Trent L. Taylor - 5/29/2007

Tim,

We have actually been trying to come up with a "reasonable" and simple solution.  At the moment it requires a bit of work just due to the fact of how the UltraGrid bands are expecting to interact with the objects.  I know that Ben had played with this quite a while the other day and we do not have a straight forward answer on this topic yet.

By Tim Dol - 5/29/2007

Trent, thank you for the update and I appeciate all the effort. I'm crossing my fingers...

Tim

By Bastian Töpfer - 9/14/2007

Any news on that topic?
By Paul Chase - 9/17/2007

What I did was create a class the inherits from data set and implements Icontainer control. I then use this as a datasource for the grid. I am only using it read only and not for data entry but I suppose that you could. 
By Trent L. Taylor - 9/17/2007

One option that may work as well is creating a custom data source that inherits the BBS (BusinessBindingSource) then create child properties that expose other BBS classes.  This is the approach that we have taken with our reports and I have not tested it on this grid.  We ended up create a custom object model for all of our complicated grid interaction that has the logic to go and update the BOs.  But what I am talking about above would be something like this:

Public Class MyCustomersBBS
    Inherits MicroFour.StrataFrame.Business.BusinessBindingSource

    Public Sub New()
        MyBase.New()
        Me.BusinessObject = New CustomersBO()
    End Sub
End Class

Public Class MyOrdersBBS
    Inherits MicroFour.StrataFrame.Business.BusinessBindingSource

    Public Sub New()
        MyBase.New()
        Me.BusinessObject = New OrdersBO()
    End Sub
End Class

Public Class CustomersBO
    Inherits MicroFour.StrataFrame.Business.BusinessLayer

    Private Shared _OrdersBBS As New MyOrdersBBS

    Public ReadOnly Property Orders() As MyOrdersBBS
        Get
            Dim lcFilter As String = "or_cust_pk=" & Me.cust_pk.ToString()
            If Not _OrdersBBS.BusinessObject.Filter.Equals(lcFilter) Then
                _OrdersBBS.BusinessObject.Filter = lcFilter
            End If
            Return _OrdersBBS
        End Get
    End Property

    Private Sub CustomersBO_CurrentDataTableRefilled() Handles Me.CurrentDataTableRefilled
        If Not Me.DesignMode Then
            _OrdersBBS.BusinessObject.FillByParent(Me)
        End If
    End Sub
End Class

Then when you bind the CustomersBBS you will have the orders, etc.  This will obviously take some "tweaking" and I have not tested it on a grid.  But it might be a different approach to try.  You will probably have to take into account the navigated event to apply the filter since this is associated with a grid.  But it is just a thought. Smile

By Paul Chase - 9/17/2007

Here is a sample using both the Infragistics and Dev Ex grid and the SF Sample Data.

Basically you drag and drop your business objects onto a data set and then drag the dataset onto the form and set the datasource of the grid or report. I haven't had any problems using it so far actually I worked on it over the last week and a little over the weekend.