We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

CustomSummary - CreateSummaryMethod Being Called But Not Shown on Grid

Hi, I have a grouping grid with Custom Summary objects derived from SummaryBase My class is based on the TotalSummary sample class. I can see lots of calls to public static ISummary CreateSummaryMethod(SummaryDescriptor sd, Record record) But the caption never actually shows my custom total - it just aggregates the values. I put a breakpoint on the overridden ToString() function as used for tooltip effect and that never actually gets called either Can anyone help?

3 Replies

AD Administrator Syncfusion Team July 29, 2004 08:32 AM

Did you create a GridSummaryRowDescriptor where the summaries can be shown? For example see that code in the CustomSummary example: GridSummaryColumnDescriptor sd1 = new GridSummaryColumnDescriptor(); sd1.Name = "QuantityTotal"; sd1.DataMember = "Quantity"; sd1.DisplayColumn = "Quantity"; sd1.Format = "{Total}"; sd1.SummaryType = SummaryType.Custom; this.gridGroupingControl1.TableDescriptor.SummaryRows.Add(new GridSummaryRowDescriptor("Row 1", "Total", sd1)); Stefan


AD Administrator Syncfusion Team August 2, 2004 11:23 AM

I''ve investigated this further. Everthing appears to be set up correctly. My handler is being called correctly: public static void QueryCustomSummaryHandler(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridQueryCustomSummaryEventArgs e) QueryCustomSummaryHandler is a static "factory" type method that works out which ITreeTableSummary CreateSummaryMethod(SummaryDescriptor sd, Record record) to call base on some rules. The first time I call the factory everyhting runs OK. Each subsequent time that I call it, I can see the correct CreateSummaryMethod being called but it actually displays the values from the very first factory method. Is it possible that somewhere within the SummaryDescriptor object[s] there''s a singleton or similar that is not being reset???? Thanks Jason


AD Administrator Syncfusion Team August 2, 2004 01:25 PM

Fixed it! I needed to call tableDescriptor.SummaryRows.Clear(); to clear any knowledge of previous CustomSummary objects

Loader.
Live Chat Icon For mobile
Up arrow icon