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()