Hello, I was able to handle custom summary base from this infragistics article, But base from this code
The foreach code will only iterate in the presents rows in a page only.
What I want is to summed up all rows from the whole return datasource. This code is wrong right
foreach(var gr in WebHierarchicalDataGrid1.Rows)
I'm looking for a code that will dig all results from a datasource. so I can show the summed up values from page to page.
Note : Non Custom Summaries summed all results from result, even from page to page.
I hope I can implement the same functionality in CustomSummary.
Please take a look this undesired results and notice how the non custom summary value retain the sum even in paging.
Thank you and best regards,
Sherwin
Hi Sherwin,
When you want to calculate a custom summary, it is up to you to calculate it. You are correct in the fact that the rows will only contain rows on the page. You'll have to iterate through your data source one by one. What may help is off the grid (the sender in the event), you can do GetDataView().DataAdapter.Records.GetOriginalEnumerator() to get access to the original data. This should return all of it depending upon the data source. Use that to calculate the standard deviation.
regards,David Young
Hi David,
Thank you for your reply, This is a little bit late because of long weekend, anyway the solution that you have provided is correct, It can access the original datasource of the sender, But what if, if the user enables some column filtering? I think it will still compute the rows in the datasource.
The non custom summary also handles computation for filtered rows. I don' know if what datasource should I iterate through so I could do the same functionality.
Thanks and Best Regards,
For regular summaries, there is EnableSummariesFilter which determines whether filtered out records are included as part of the summaries. You will have to do the same thing. You may be able to get access to the FilterRecord and use compareTo to figure out if it part of the data being shown. You'd have to make a DataRecord first out of the data object. Or just do the coding for filtering yourself.
-Dave