There is only one special case in which it is not possible to recalculate the new summary on the client. This can happen if the data required for calculating is not (or might not be) available on the client, for example when paging is enabled.
For example, when user delete a row that contains either a minimum or maximum value or just edit a cell containing such value, then the new minimum/maximum should be calculated. But if the new minimum/maximum value is not available on the client of if you are not whether it is available and cannot check this, you cannot retrieve the new minimum/maximum.
In such cases, a special event, called “SummaryRowClientEvents-CalculateSummary”, is fired. It can be handled by you, as the developer, and you can decide, for example, to set a new value or make some modifications to the event arguments and then force a postback and accept the changes. You can also revert the deleted changes on the client side and make no postbacks. If you leave this event unhandled, then automatic postback is called internally and the new extreme value is calculated automatically.
For other summary values like Count, Average, and Sum, all recalculations take place on the client.
To attach to the SummaryRowClientEvents-CalculateSummary event, use this line of codes:
<ig:WebHierarchicalDataGrid ID="wdg1" runat="server">
<Behaviors>
<ig:EditingCore BatchUpdating="true">
<Behaviors>
<ig:RowAdding/>
<ig:RowDeleting/>
<ig:CellEditing/>
</Behaviors>
</ig:EditingCore>
<ig:SummaryRow
SummaryRowClientEvents-CalculateSummary="wdg1CalculateSummary">
</ig:SummaryRow>
<ig:Selection
CellClickAction="Row" RowSelectType="Multiple"></ig:Selection>
<ig:Paging></ig:Paging>
</Behaviors>
</ig:WebHierarchicalDataGrid>
And define handler using javascript code:
function wdg1CalculateSummary(sender, eventArgs) {
}
Note
|
Note:
If you want to attach to the child band you need to do the same in each band.
|
For a real-life code example about how to handle the SummaryRowClientEvents-CalculateSummary event, refer to the Batch Update Summary sample. The sample is for the WebDataGrid but you can achieve the same in the Hierarchical one.