Along these same lines...
How can I control the header.caption of a groupby row?
I was able to remove the column header that was grouped, but now I am left with ': CATEGORYNMAME (N items).
I want to be able to write my own captions, or at least get ride of the ':' and the number of items in the perenthaces.
This gets what I was looking for:
Private Sub grdFilters_InitializeGroupByRow(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeGroupByRowEventArgs) Handles grdFilters.InitializeGroupByRow If e.Row.Rows.VisibleRowCount > 0 Then Dim firstChildRow As Infragistics.Win.UltraWinGrid.UltraGridRow = e.Row Dim enumeratorForChildRows As Infragistics.Win.UltraWinGrid.RowEnumerator = Nothing 'We can have multiple group by layers. Iterate to the first 'non group-by row and read the data then While firstChildRow.IsGroupByRow enumeratorForChildRows = DirectCast(firstChildRow, Infragistics.Win.UltraWinGrid.UltraGridGroupByRow).Rows.GetEnumerator() enumeratorForChildRows.MoveNext() firstChildRow = enumeratorForChildRows.Current End While If enumeratorForChildRows IsNot Nothing Then 'Find first usable row with data While firstChildRow.Hidden OrElse Not firstChildRow.IsDataRow OrElse firstChildRow.IsFilteredOut If Not enumeratorForChildRows.MoveNext() Then 'No usable rows with data found (should be pretty uncommon situation) 'just return Exit Sub End If firstChildRow = enumeratorForChildRows.Current End While e.Row.Description = CStr(iif(strings.Len(firstChildRow.Cells(e.Row.Column).Text) = 0, _ "Misc.", firstChildRow.Cells(e.Row.Column).Text)) End If End If End Sub
A simpler solution may be to change the GroupByRowDescriptionMask property, which is what the grid uses to determine what to display by default in the group-by row's Description property. This property exists off the Override object, so you can set it for the whole grid from DisplayLayout.Override.GroupByRowDescriptionMask, or change it for an individual band by setting that band's Override.GroupByRowDescriptionMask.
The default value of this property is the following string: "[caption] : [value] ([count] [count,items,item,items])"
If you want to display only the value in the grouped column at a particular level, you can set your GroupByRowDescripitonMask to "[value]".
The primary difference between this and your implementation of the InitializeGroupByRow method is that you're substituting "Misc." in for a blank value. If this is a requirement, then the code you've provided is the way to accomplish this result.
Hi Vince,
Can we control GroupByRowDescriptionMask property for showing subtotal of columns other than the groupby column. If not then is there any other way to meet this requirement.
pls suggest me some solution for this.
Thanks Vince.
It's hard to answer your question without more information. It sounds like you could just use the SummarySettings.DisplayFormat to format your summaries however you want. That has nothing to do with GroupByRows - or at least it's not specific to GroupByRows.
Hi,
I'm afraid I do not understand what you are asking. Can you post a screen shot?
Hi Mike,
I got the solution for the above issue. what i did is in property GroupByRowDescriptionMaskDefault i inserted some extra code ie. [caption] : [value] ([count]) EOQty: [sum:EOQty]. This gives me the subtotal of any column whixh i want.
Now i have another qstn ie. after dragging any column for groupby the alignment of the header and the below rows gets unmatched as the groupby column goes away from the grid.
so this unproper alignment makes it look bad.
so pls suggest me any soln for this.
Thnks Mike.