Hi,
Quick question, it's possible add the OutlookGroupBy Label using to group, on both top and bottom of witch group, just inline or above the Sum box, like on this picture:
My code:
' Agrupar por grupos
UltraGrid1.DisplayLayout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.OutlookGroupBy
UltraGrid1.DisplayLayout.GroupByBox.Hidden = True
UltraGrid1.DisplayLayout.Bands(0).SortedColumns.Add("Tarifario", False, True)
UltraGrid1.DisplayLayout.Bands(0).Override.SummaryDisplayArea = Infragistics.Win.UltraWinGrid.SummaryDisplayAreas.Bottom _
Or Infragistics.Win.UltraWinGrid.SummaryDisplayAreas.GroupByRowsFooter
Regards!
Hugo
Hi Hugo,
The grid doesn't have any built-in functionality to do this. But since you have a summary row there on the bottom of the rows collection, you could achieve what you want in a couple of different ways.
One way would be to create a Custom summary and just return the text you want. But this would limit your to displaying the summary aligned with a column (which probably won't be wide enough) or aligned left (which means it would be no a different line than your other summaries).
So a better solution in your case would be to use a CreationFilter. Have you used CreationFilters before?
Eish, i was thinking that gonna be just a simple line of code or someting. =P
No Mike, never used a CreationFilter before. Can you give me a help?
How about the label that says "Summaries.." or "Totals"..Dont remember well, I erased it. Can i changed it for the groups?
HugoCore said:How about the label that says "Summaries.." or "Totals"..Dont remember well, I erased it. Can i changed it for the groups?
You could do that, but you still need a CreationFilter and then the GroupByRow text would be on a separate line than the summaries. Is that what you want?
From the screen shot you posted here, it looks like the GroupByRow text will not fit into the spot you want it. So putting it on it's own row in the SummaryFooterCaption is probably a good idea.
Just let me know where you want it and I will whip up a sample CreationFilter to help you out.
There's a sample posted by another customer here which shows how to move the SummaryFooter text into the summary row. So you could combine the two and just use the text from the GroupByRow instead of the normal SummaryFooter text.
Mike,
Can you give some help to get the label in only a row ?
Like this:
That would be Great!!
"My" code:
Private Sub IUIElementCreationFilter_AfterCreateChildElements(ByVal parent As Infragistics.Win.UIElement) Implements Infragistics.Win.IUIElementCreationFilter.AfterCreateChildElements If TypeOf parent Is Infragistics.Win.UltraWinGrid.SummaryFooterCaptionUIElement Then ' Get the Text UIElement inside the summary footer caption UIElement. Dim textUIElement As Infragistics.Win.TextUIElement = TryCast(parent.GetDescendant(GetType(Infragistics.Win.TextUIElement)), Infragistics.Win.TextUIElement) If textUIElement IsNot Nothing Then ' Get the associated rows collection. Dim rows As Infragistics.Win.UltraWinGrid.RowsCollection = TryCast(parent.GetContext(GetType(Infragistics.Win.UltraWinGrid.RowsCollection)), Infragistics.Win.UltraWinGrid.RowsCollection) If rows IsNot Nothing Then ' Get the GroupByRow which is the parent of the rows collection. Dim groupByRow As Infragistics.Win.UltraWinGrid.UltraGridGroupByRow = TryCast(rows.ParentRow, Infragistics.Win.UltraWinGrid.UltraGridGroupByRow) If groupByRow IsNot Nothing Then ' Set the text of the Text UIElement inside the SummaryFooterCaption to ' the description text on the GroupByRow textUIElement.Text = groupByRow.Description Else textUIElement.Text = "Totais" End If End If End If End If
End Sub
Thank you so much!
Regars
Okay, here's a quick sample I whipped up that replaces the text in the SummaryFooterUIElement's TextUIElement with the Description property of the GroupByRow.
Mike, feel free to choose. Inline or above the sum's it's good to me.
The witdh of text it's in general the one from the screen shot.