I'm trying to add a summary to a grid that has to bands. I only want to add the summary to the parent band but the summary keeps showing up in the child band. I've checked at runtime and the child band has no summaries.
Private Sub MyUltraGrid_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles MyUltraGrid.InitializeLayout
Try
For Each col As UltraGridColumn In Me.MyUltraGrid.DisplayLayout.Bands(0).Columns
col.CellActivation = Activation.NoEdit
Next
Me.MyUltraGrid.DisplayLayout.AutoFitStyle = AutoFitStyle.ExtendLastColumn
With MyUltraGrid.DisplayLayout.Bands(0)
.ColHeaderLines = 2
.Override.HeaderPlacement = HeaderPlacement.FixedOnTop
.Columns("Name").Width = 180
.Columns("CountryCode").Header.Caption = "Country"
.Columns("CountryCode").Width = 55
.Columns("CurrencyCode").Header.Caption = "Curncy"
.Columns("CurrencyCode").Width = 55
.Columns("PriceCurrencyCode").Header.Caption = "Price Curncy"
.Columns("PriceCurrencyCode").Width = 70
.Columns("Shares").Header.Caption = "Shares"
.Columns("Shares").CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right
.Columns("Shares").Format = "#,##0"
.Columns("BasePrice").Header.Caption = "Base Price"
.Columns("BasePrice").CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right
.Columns("BasePrice").Format = "#,##0.00"
.Columns("BaseValue").Header.Caption = "Base Value"
.Columns("BaseValue").CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right
.Columns("BaseValue").Format = "#,##0.00"
.Columns("TotalCostPercentage").Header.Caption = "Total Cost %"
.Columns("TotalCostPercentage").CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right
.Columns("TotalCostPercentage").Format = "#,##0.0000%"
.Columns("TotalCostPercentage").CellAppearance.BackColor = PreferencesManager.GetSingleton.psHighlightColour
.Columns("TotalCostDollars").Header.Caption = "Total Cost $"
.Columns("TotalCostDollars").CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right
.Columns("TotalCostDollars").Format = "#,##0.00"
End With
If MyUltraGrid.DisplayLayout.Bands.Count > 1 Then
With MyUltraGrid.DisplayLayout.Bands(1)
.ColHeaderLines = 1
.Override.SummaryDisplayArea = SummaryDisplayAreas.None
.Override.AllowRowSummaries = AllowRowSummaries.False
.Columns("Order").CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right
.Columns("Size").CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right
.Columns("Cost").Header.Caption = "Cost bps"
.Columns("Cost").CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right
.Columns("Cost").Width = 60
.Columns("BasePrice").Width = 70
.Columns("BucketCost").Header.Caption = "Bucket Cost $"
.Columns("BucketCost").Format = "#,##0.00"
End If
If Me.MyUltraGrid.DisplayLayout.Bands(0).ColHeaderLines > 1 Then
With e.Layout
.Override.SummaryFooterCaptionVisible = Infragistics.Win.DefaultableBoolean.False
With e.Layout.Bands(0)
Dim ss As SummarySettings
.Summaries.Clear()
ss = .Summaries.Add("Base Value", SummaryType.Sum, .Columns("BaseValue"), SummaryPosition.UseSummaryPositionColumn)
ss.Appearance.BackColor = PreferencesManager.GetSingleton.SUMMARY_ROW_COLOUR
ss.Appearance.TextHAlign = Infragistics.Win.HAlign.Right
ss.DisplayFormat = "{0:#,##0.00}"
ss = .Summaries.Add("Total Cost Dollars", SummaryType.Sum, .Columns("TotalCostDollars"), SummaryPosition.UseSummaryPositionColumn)
.Override.SummaryDisplayArea = SummaryDisplayAreas.Default
.Override.GroupBySummaryDisplayStyle = GroupBySummaryDisplayStyle.SummaryCells
Catch ex As Exception
End Try
End Sub
Hello Temitayo Akinsanya,
Thank you for posting in our forums!
Please answer the following questions:
1. What version and build of Infragistics are you experiencing this on? e.g. 17.2.20172.20062. What other properties are you setting on your UltraGrid?3. Are you using any styling?4. Can you provide any screenshots of the behavior you are seeing?
I am not able to reproduce this behavior in my attached sample. I used the code you provided in a simple sample and the summaries show up in the parent band as expected.
0246.UltraGrid_ParentSummary.zip
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was performed using version 17.2.20172.2006 in Infragistics WinForms 2017 Volume 2.
If the project does show the product feature working correctly, then more information will be needed to reproduce the issue in a sample that can be used for debugging. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing. This can be done by either making the sample that I provided more like your application or by isolating the behavior from your application by removing dependencies on any third parties or databases.
Please let me know if I can provide any further assistance.
Thanks Michael. I seemed to have found the issue. I was setting a new creation filter on the ultra grid which seemed to be causing the issue. When the creation filter was removed, the summary no longer appeared in the child band.