Private Sub Add_Summaries()
band.Summaries.Clear()
band.Summaries.Add(SummaryType.Sum, band.Columns("Labor_Unit"), SummaryPosition.UseSummaryPositionColumn)
End Sub
When the code hits the 2nd Add method ("Labor_Unit"), an error is raised:
Error #9 was generated by Infragistics2.Win.UltraWinCalcManager .v.7.2
Index was outside the bounds of the array.
What am I doing wrong?
This is on a windows form.
Thanks,
Jeff Keryk (a new user)
Labor_Unit is the right key? Is Labor_Unit derived from a formula? Not sure this will make any difference but you might use the overload of .Add where you can give it a key yourself. like .Add('Key1", Summarytype.Maximum .....
Nick
Dim band As UltraGridBand = Me.UltraGrid1.DisplayLayout.Bands(BAND_MPS)band.Summaries.Add("SubScr", SummaryType.Formula, band.Columns("SubScr"), SummaryPosition.UseSummaryPositionColumn)
With band.Summaries("SubScr") .Formula = "MAX([SubScr])" .Appearance.TextHAlign = HAlign.Right .SummaryDisplayArea = SummaryDisplayAreas.BottomFixed .DisplayFormat = "{0:##,##0}"End WithMe.UltraCalcManager1.ReCalc()
band.Summaries.Add("Labor_Unit", SummaryType.Formula, band.Columns("Labor_Unit"), SummaryPosition.UseSummaryPositionColumn)With band.Summaries("Labor_Unit") .Formula = "SUM([Labor_Unit])" .Appearance.TextHAlign = HAlign.Right .SummaryDisplayArea = SummaryDisplayAreas.BottomFixed .DisplayFormat = "{0:##,##0}"End WithMe.UltraCalcManager1.ReCalc()
I contunue to struggle with this problem. It is possible the 3 band grid I am using is contributing... The error is intermittent. The Me.UltraCalcManager1.ReCalc(-1) method is raising the error, and I believe it is a software bug rather than my code. I have submitted a development request. Any help is appreciated, because I cannot release any applications without subtotals.
What version of the controls are you using? Do you have the latest Hot Fix? This looks like it might be an issue that was already fixed.
I upgraded to 8.2.20082.
I believe this will solve the problem.
I appreciate your support.