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

Getting a summary value after it has changed

Hi,

I have two controls on my screen, one is a GridGroupingControl, the other is a regular textbox. The GGC has a hidden summary row which sums the values in a given column; the user can edit the detail values in that column. The textbox shows the sum of the values in the column, and it gets its value from the hidden summary.

What I''d like to do is catch the event that occurs whenever the summary value for this column is changed. If the user changes a column not involved in the calculation, I don''t need to track it; I only want to update the textbox with the new sum whenever it has actually changed.

Which event handler would be the best to use for this, or which method should be overriden? I''ve tried TableControl_CurrentCellEditingComplete, TableControl_CurrentCellAcceptedChanges and TableControlCurrentCellValidated, but the sum returned always seems to be for the values in the table *before* the edit was peformed.

Thanks,
Michael

1 Reply

AD Administrator Syncfusion Team September 27, 2006 07:25 AM UTC

Hi Michael,

Try handling the GroupSummaryInvalidated event to get the updated summary value in a grid. Below is a code snippet

private void grid_GroupSummaryInvalidated(object sender, Syncfusion.Grouping.GroupEventArgs e)
{
e.Group.ParentTable.SummariesDirty = true;

GridGroupingControl grid = sender as GridGroupingControl;
GridTableControl tc = grid.GetTableControl(e.Group.ParentTableDescriptor.Name);
tc.RefreshRange(GridRangeInfo.Cell(8,3));

textbox1.Text = tc.Model[8,3].Text;
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon