I was able to create a summary at the bottom of a column named "Minutes" that adds up all minutes in the parent rows. My questions is how to perform the math to show those minutes as hours and minutes? For example 90 minutes would display as 1:30.
Hello,
I just wanted to know if you were able to solve your issue based on the Brian suggestion or you still need help? Just let me know. Thank you.
Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.
You could implement the ICustomSummaryCalculator interface and assign that implementation to the SummarySettings.CustomSummaryCalculator property (you must also set the SummarySettings.SummaryType property to 'Custom').
Example:public class CustomSummaryCalculator : ICustomSummaryCalculator{ private int totalMinutes = 0;
#region ICustomSummaryCalculator Members
void ICustomSummaryCalculator.AggregateCustomSummary(SummarySettings summarySettings, UltraGridRow row) { object value = row.Cells[summarySettings.SourceColumn].Value; if ( value is int ) { this.totalMinutes += (int)value; } }
void ICustomSummaryCalculator.BeginCustomSummary(SummarySettings summarySettings, RowsCollection rows) { this.totalMinutes = 0; }
object ICustomSummaryCalculator.EndCustomSummary(SummarySettings summarySettings, RowsCollection rows) { TimeSpan ts = TimeSpan.FromMinutes( this.totalMinutes ); return string.Format( "{0}:{1}", (int)ts.TotalHours, ts.Minutes ); }}