Hi!
I've got an interesting problem regarding Bands. I've seen the UltraGrid produce this before, unintentionally, when testing some binding, but now I want to use this behavior to perform a linear grouping.
The structure is simple: Invoice > Invoice Item, that's it.
Its currently a BindingList(Of Invoice) with a child band resolved from BindingList(Of InvoiceItem)
At the moment, it's being presented as:
Invoice 1
+-- InvoiceItem 1 - 1 InvoiceItem 1 - 2 InvoiceItem 1 - 3 InvoiceItem 2 - 1 InvoiceItem 2 - 2 InvoiceItem 2 - 3Invoice 2 etc
I'd like it to follow this pattern of multiple bands (therefore I can produce running totals etc)
BAND (0)
Invoice 1BAND 1 InvoiceItem 1 - 1 InvoiceItem 1 - 2 InvoiceItem 1 - 3BAND 1 (again) InvoiceItem 2 - 1 InvoiceItem 2 - 2 InvoiceItem 2 - 3
I've tried BindingList(Of Invoice) with a child band set resolved from BindingList(Of BindingList(Of InvoiceItem)) but with no luck.
Any ideas?
Thanks, Tom
Oh just to add to this, I haven't just changed the type (duh), I've also changed my grouping function to accommodate for this, so the structure really does match the intended band hierarchy.
Hi,
It looks like you just want to use OutlookGroupBy on your second band. To do this, you use the SortedColumns.Add method on the band and use the overload that takes three parameters - the third one is whether to group or not. You also need to set the grid.DisplayLayout.ViewStyleBand to OutlookGroupBy.
Hi Mike!
Thanks for the quick reply. Ok this does virtually everything I need, *except* it shows the GroupByRow. I've set the GroupByRowDescriptionMask, IndentationGroupByRow = 0 and IndentationGroupByRowExpansionIndicator = 0 too, to limit the area as much as possible.
Previous posts suggest that removing the group by row, without hiding it's child rows is impossible. Is this true?
Thanks again, Tom
Hi Tom,
Yes, that's correct. There's no way to do grouping without displaying the GroupByRow.