Hi,
In my application, for the wingrid i have added a Summary for few of the columns. The summary works fine when the grid is bounded with data. Also when any filter is applied for any of the grid columns etc.
For the gird i have set the option to select multiple rows (by moving the mouse over rows headers , also holding the shift button and click on the required rows)
Now we want to refresh the Summary total for the selected records (rows). (sample screen shot attached, selected records background color are changed)
Can anyone suggest how to refresh the summary for the only selected rows ?
Thanks,
Narasimha
Hi Mike,
As you said the summary automatically updates when the column is ungrouped. Actually the custom code which i had written to use the summary result had issue, which led me to wonder if the summary was updating or not.
The grid feature is fine.
The summary should, of course, be automatically updated when you un-group a column. If that's not happening it's a bug.
But I'm a little unclear on exactly what you mean when you say it's staying in the previous state. After you remove the grouping, is the summary visible on the screen? What exactly is it maintaining the previous state of? When the grid is grouped, there are multiple summaries, so are you saying it's picking some arbitrary group and displaying the value from that group after the grouping is removed? That doesn't make much sense.
hi brian,
I have another question, when a column header is dragged to group by that column the summary gets automatically updated. But the reverse does not happen, that is when the grouping is removed the summary remains at the previous state.
Should the summary update automatically? can you please suggest how to refresh the summary for this scenario?
Hi Brian,
I did something similar, in the AfterRowSelected event i am looping through the selected row collection and doing the necessary math operation on the columns for which i need the summary.
I had used the approach which you mentioned for doing a distinct count of values for a certain column, this approach is used to shown summary when the grid is bound with data and when a row filter is applied.
thanks for your suggestion
narasimha
You can create a class that implements the ICustomSummaryCalculator interface (only three methods). This is the interface with which the grid's summary compilation logic communicates, so you effectively take control over the summary calculations by doing this. In your 'AggregateCustomSummary' method implementation, you would add the cell values only for the selected rows.