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.
Unfortunately, activation email could not send to your email. Please try again.

Getting a summary value after it has changed

Thread ID:

Created:

Updated:

Platform:

Replies:

49789 Sep 26,2006 07:15 PM Sep 27,2006 03:25 AM Windows Forms 1
loading
Tags: Grouping
Michael Lorenz
Asked On September 26, 2006 07:15 PM

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

Administrator [Syncfusion]
Replied On September 27, 2006 03:25 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;