We are using Infragistics Win grid Version 8.3.20083.2021.
We want a group summary to be displayed on the group header along with the custom caption. Please find attached the snap shot for your reference.
Hi,
I'm not sure what you are asking.
Summaries display in the GroupByRow by default. You don't have to do anything. Ar eyou asking how to add sumaries to the grid? If that's the case, you use the Summaries collection on the band.
I recommend doing this in the InitializeLayout event. Something like:
e.Layout.Bands[0].Summaries.Add(...);
we have manage to summary in group header but we want it Right aligned of group header
One thing is important summary display header display like “Total Cost” instead of column name of dataset(“TotalCost”)
There is following code
Dim StrFormat As String
Dim band As UltraGridBand = ulGridEstimateDetail.DisplayLayout.Bands(0)
Dim sumTotalCost As SummarySettings = band.Summaries.Add(SummaryType.Sum, band.Columns("TotalCost"))
With sumTotalCost
.SummaryPosition = SummaryPosition.UseSummaryPositionColumn
.SummaryPosition = SummaryPosition.Right
.Appearance.TextHAlign = HAlign.Right
.DisplayFormat = "$ {0:#####0.00}"
.SummaryDisplayArea = SummaryDisplayAreas.InGroupByRows
.Appearance.TextHAlign = Infragistics.Win.HAlign.Right
End With
band.Override.BorderStyleSummaryValue = Infragistics.Win.UIElementBorderStyle.None
band.Override.SummaryValueAppearance.FontData.Bold = DefaultableBoolean.True
ulGridEstimateDetail.DisplayLayout.Override.SummaryFooterCaptionVisible = Infragistics.Win.DefaultableBoolean.False
Let us your correction in code
There's no way to right-align the summaries like you have shown here. But you can use the GroupBySummaryDisplayStyle property to make the summaries align with the actual columns in the grid.
Regarding "TotalCost", this is taken from the caption of the column. So you probably want to set the column.Header.Caption to "Total Cost" and then the column header and the summary will both the caption.
Once you switch to using SummaryCells, though, the caption will no longer be displayed on the summary automatically. In that case, you can simply update the DisplayFormat on the summary to say whatever you want.
.DisplayFormat = "Total Cost: $ {0:#####0.00}"
Hi Mike,
Thanks for your reply.
We have changed the style of displaying the summary in the group header. We want to display the summary on its respective column header, please find below the code we have written for it :
Dim sumTotalCost As SummarySettings =
band.Summaries.Add(SummaryType.Sum, band.Columns("TotalCost"))
Dim sumTotalPrice As SummarySettings =
band.Summaries.Add(SummaryType.Sum, band.Columns("TotalPrice"))
With sumTotalPrice
.Key = "TotalPrice"
.ToolTipText = "Total Price"
ulGridEstimateDetail.DisplayLayout.Override.GroupBySummaryDisplayStyle = GroupBySummaryDisplayStyle.SummaryCells
We want the header column total to be right aligned and also want to format it. Please find attached the snap shot for the same