Hi to all!
Can someone help me out on this issue, that i have been searching and searching and nothing.I need to have somes rows like a sub-total of that group of rows.Like this:
| Col1 | Col2| Col3 | Qtd. | Money| A | X | X | 2 | 3€ | A | X | X | 3 | 7.10€| Sub-total | 5 | 10.10€ ( <- How to create this sub-total for lines A?) | B | X | X | 1 | 5€| B | X | X | 1 | 1€| Sub-total | 2 | 6€ ( <-How to create this sub-total for lines B?) | Total | 7 | 16.10€
I need all rows visible, sub-totals and grand-total.
Sample would be great...
MANY THANKS!!
Hi
There isn't any image attached to your post.
But you can format the summary any way you like using the DisplayFormat property on the SummarySettings.
Ok.,I'll try Mike.
One another interesting thing that i noticed is about formatting the summary groupby column value. My case is, it is a decimal and if the rows have decimals, it displays summary as decimals, else it just ignores (which might be the correct way). But i'm looking for setting the format always to decimal so that it will read always as 00.00. I have attached a screenshot.
The first and last summaries in the screenshot are just integers though the column is formatted to decimal.
Any help is appreciated.
Hi,
Oddly enough, while the default summary footer caption text is different between the regular summaries and the grand totals, there is only a single property to set this.
So the only way to do this would be to use a CreationFilter.
Something like this:
private void Form1_Load(object sender, EventArgs e) { this.ultraGrid1.CreationFilter = new MyGrandTotalsSummaryFooterCreationFilter("Total SUM"); }
public class MyGrandTotalsSummaryFooterCreationFilter : IUIElementCreationFilter { private string summaryFooterCaption; public MyGrandTotalsSummaryFooterCreationFilter(string summaryFooterCaption) { this.summaryFooterCaption = summaryFooterCaption; } public void AfterCreateChildElements(UIElement parent) { SummaryFooterCaptionUIElement summaryFooterCaptionUIElement = parent as SummaryFooterCaptionUIElement; if (null == summaryFooterCaptionUIElement) return; ImageAndTextUIElementEx imageAndTextUIElementEx = summaryFooterCaptionUIElement.GetDescendant(typeof(ImageAndTextUIElementEx)) as ImageAndTextUIElementEx; if (null == imageAndTextUIElementEx) return; imageAndTextUIElementEx.Text = this.summaryFooterCaption; } public bool BeforeCreateChildElements(UIElement parent) { // Do nothing. return false; } }
One more requirement is to have the text displayed in the summary for each group and then a different text in the final summary row. For example: the Groupby row summary for each group should read "SUM" and then the the final summary footer should read "Total SUM".(which makes better readability for the users) I tried to set SummaryFooterCaption, but that seems to be common for the grouped rows as well as the final summary footer. Am i missing something ?
There's no simple way to do that. You could, of course, just loop through the grid rows and perform the summary calculation yourself.