Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
965
Force Summary Row Formula Recalculation after a Group By
posted

Hello,

I am using version 14.1. Some columns in my grid use formulas to build the summary row. They are rather simple and just combine values from other columns. After the grid is filtered or grouped I need to recalc the formulas.

I have the filtering working good but can't seem to get the recalc to work after the grid is grouped.

Here is the code I use after a filter. Please advise on how to pull this off after a grouping.


private void ugGrid1_AfterRowFilterChanged ( object sender, AfterRowFilterChangedEventArgs e )
{
			UltraGrid ugGrid = (UltraGrid)sender;
			UltraGridBand Band = ugGrid.DisplayLayout.Bands[0];
 
			RecalcTwoFieldString( Band, ugGrid );
}

public static void RecalcTwoFieldString ( UltraGridBand Band, UltraGrid ugGrid )
{
		Band.Summaries["TwoFieldString"].DisplayFormat = ugGrid.Rows.SummaryValues["TwoField1"].Value.ToString() + "/" + ugGrid.Rows.SummaryValues["TwoField2"].Value.ToString();
}
  • 29105
    Offline posted

    Hello,

    I hope Mike's response has helped you. If at any point you have any questions please do not hesitate to ask.

  • 469350
    Suggested Answer
    Offline posted

    Hi,

    By default, the CalcManager is set up to automatically perform calculations asynchronously as things change. So you shouldn't have to do anything in order to update these summaries when the grid is grouped.

    If you change the CalcFrequency to Manual, then you would have to force a recalculation every time anything changed. You do this by calling the Recalc method on the UltraCalcManager.

    If your CalcFrequency is set to the default and the summaries are not recalculating, it might be that it's just taking some time or it could be a bug. You might want to get the latest service release for the controls as there were some problems with summaries not recalculating properly that were recently fixed.

    How to get the latest service release - Windows Forms - Service Releases