Hi,
How do i add grand total to the ultragrid?
I am using the following code but it doesnt seem to show the grand total.
UltraGridBand band = sGridName.DisplayLayout.Bands[0];
sGridName.DisplayLayout.Bands[0].Columns[sColName].AllowRowSummaries =AllowRowSummaries.True;
SummarySettings SumSummary = band.Summaries.Add("Sum " + sColName, SummaryType.Sum, band.Columns[sColName]);
SumSummary.DisplayFormat ="{0:#,##0.00}";
SumSummary.Appearance.TextHAlign =HAlign.Right;
SumSummary.SummaryDisplayArea |=SummaryDisplayAreas.Bottom;
//sGridName.DisplayLayout.Override.SummaryDisplayArea = SummaryDisplayAreas.Bottom;
band.SummaryFooterCaption ="Subtotal:";
band.Override.SummaryFooterCaptionAppearance.FontData.Bold =DefaultableBoolean.True;
band.Override.SummaryFooterCaptionAppearance.BackColor =Color.LightSteelBlue;
band.Override.SummaryFooterCaptionAppearance.ForeColor =Color.Black;
// Here, I want to add grand total
UltraGridColumn columnToSummarize = band.Layout.Bands[0].Columns[sColName];
SummarySettings summary = band.Layout.Bands[0].Summaries.Add("Grand Total For "+sColName, SummaryType.Sum, columnToSummarize);
summary.DisplayFormat ="{0:#,##0.00}";
summary.SummaryDisplayArea |=SummaryDisplayAreas.GroupByRowsFooter;
summary.Appearance.TextHAlign =HAlign.Right;
// Disable grid default highlight
sGridName.DisplayLayout.Override.ResetActiveRowAppearance();
sGridName.DisplayLayout.Override.ResetActiveCellAppearance();
sGridName.DisplayLayout.Override.ActiveAppearancesEnabled =DefaultableBoolean.False;
Thanks
Hi Boris,
RefreshSummaries() fixes my issue.
Thank you so much.
Hello joeleesin,
Thank you for your patience. I have completely misunderstood your scenario. Now I believe that I am on the right track.
I will need some time to examine this behavior by our WinGrid control. So I created the following case for you: "CAS-98400-V8S8X6" where I will let you know of the results.
In the meantime what you could use as a workaround would be to handle to 'AfterExitEditMode' event of the control and use the following line of code:
ultraGrid1.DisplayLayout.RefreshSummaries();
Feel free to let me know if the above suits your needs.
Thank you for using our controls and components. I will update you soon on that matter.
Hello,
I've been waiting for a response for about two days now, and still haven't gotten any feedback from you guys yet. I am sorry if I wasn't so clear with my questions , but could someone please help me out resolving the issues that I have encountered?
Hi Guys,
The allow row sum in the sub group does not seem to add up correctly. I have attached a screenshot for your review.
First, change the sub group value to 1 and tab out the cell. You will see that the subtotal value stays the same(14) until you collapse the second group.
Do you have any ideas what causes this strange behavior?
Thank you.
The screenshot was actually two posts above it. Here is another screenshot.