I have UltraDataSource with columns of type integer of minutes value.
My grid summarizes this values as expected, but always displayed as minutes. For grid cells i'm using my datafilter class to display the cell value in hh:mm format. This workd fine, even if my grid is grouped by.
To avoid implementing and maintaining custom summaries (I have read other posts about that), I like to use my datafilter for the summaries as well.
Is that possible?
If not what is the easiest way to achieve displaying minutes as hh:mm in group-by grid?
Thanks
Markus
Hello,
Thank you for posting to our forum.
To display the hour:minutes in the summary you could do something like this:
var layout = e.Layout; var ov = layout.Override; var band = layout.Bands[0];
var minutesColumn = band.Columns["Minutes"]; minutesColumn.Format = "hh:mm"; minutesColumn.FormatInfo = new MinuteFormatter();
var minutesSummarySettings = band.Summaries.Add(SummaryType.Sum, minutesColumn); minutesSummarySettings.DisplayFormat = "{0:hh:mm}"; minutesSummarySettings.DisplayFormatProvider = new MinuteFormatter();
I have also attached the sample project i have created .
Please let me know if you need further assistance.
WinGrid_MinuteFormatter.zip
Hello, thank you for your sample. I could apply the ICustomFormatter to my project and it works generally: Summary was formatted hh:mm but normal grid cells not but if I still use my data filter all values looking good now exept I like to have always 2 chars for minutes: 8:0 -> 8:00 and suppress 0:00. I can make a change in the formatter class.
What I could not achieve is to set a caption to the summary row (see picture attached).
My grid is grouped by department-name and shows employees with some account-values.
sumSettings.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;sumSettings.SummaryDisplayArea = SummaryDisplayAreas.GroupByRowsFooter | SummaryDisplayAreas.Bottom;
How I can set a caption like 'TOTAL' to the free area left of the summary values?
How I can set bold font only to the 'grand total' at the bottom?
Thank you for your help.