Is there a way to display only the SUM in the summaries instead of the SUM, MIN, MAX, AVG, and Count.
I basically want a Totals row at the bottom of my table with the SUM only of each column. Is that possible?
Martin -
I tried that and all it did was update the Custodian field in the grid. All of the other fields ended up getting the MIN, MAX, AVG, SUM and COUNT fields added.
Hello again,
So, in your code you have multiple "ColumnSetting" objects and in each one of those you have only one "SummaryOperand" object. What you should do is place all of the "SummaryOperand" objects in a single "ColumnSetting" object. It should be similar to this:
.ColumnSettings(cs => {
cs.ColumnSetting().ColumnKey("Custodian").SummaryOperands(so => {
so.SummaryOperand().RowDisplayLabel("Total Record Count").Type(SummaryFunction.Count).Active(true);
so.SummaryOperand().RowDisplayLabel("Total").Type(SummaryFunction.Sum).Active(true);
...
});
})
Try that and if that doesn't work I'll investigate it further.
Thanks,
Martin Stoev
Here is what I have. I've been looking it over and I am not seeing the problem to the cause, yet. I know I must be missing something so maybe a second set of eyes could help. This is being done in MVC4.
@(Html.Infragistics().Grid(lvlreport.AsQueryable()) .ID("vbgrid") .AutoFormat(GridAutoFormat.Number) .Columns(column => { column.MultiColumnHeader().HeaderText("Custodian Overlay Report").Group(g => { g.For(x => x.Custodian).Template("${Custodian}").Width("150px").HeaderText("Custodian"); g.For(x => x.SourceGBCount).HeaderText(("User File Data Size (GB)").ToString()).Width("125"); g.For(x => x.SourceItemCount).HeaderText(("User File Doc Count").ToString()).Width("75"); g.For(x => x.ProcessedGbCount).HeaderText(("Expanded Data Size (GB)").ToString()).Width("100"); g.For(x => x.ProcessedItemCount).HeaderText(("Expanded Doc Count").ToString()).Width("100"); g.For(x => x.FirstLookGbCount).HeaderText(("ECA Loaded Data Size (GB)").ToString()).Width("75"); g.For(x => x.FirstLookItemCount).HeaderText(("ECA Loaded Doc Count").ToString()).Width("75"); g.For(x => x.TotalForReviewGBCount).HeaderText(("Total Size for Review (GB)").ToString()).Width("75"); g.For(x => x.TotalForReviewItemCount).HeaderText(("Total Docs for Review").ToString()).Width("75"); });
}) .Features(features => { features.Sorting().Mode(SortingMode.Single).ColumnSettings(settings => { settings.ColumnSetting().ColumnKey("Custodian").AllowSorting(true); features.Paging().PageSize(8).Type(OpType.Local); features.Filtering().Type(OpType.Local); }); features.Summaries() .ColumnSettings(cs => {
cs.ColumnSetting().ColumnKey("Custodian").SummaryOperands(so => { so.SummaryOperand().RowDisplayLabel("Total Record Count").Type(SummaryFunction.Count).Active(true); }); cs.ColumnSetting().ColumnKey("SourceGBCount").SummaryOperands(so => { so.SummaryOperand().RowDisplayLabel("Total").Type(SummaryFunction.Sum).Active(true); }); cs.ColumnSetting().ColumnKey("SourceItemCount").SummaryOperands(so => { so.SummaryOperand().RowDisplayLabel("Total").Type(SummaryFunction.Sum).Active(true); }); cs.ColumnSetting().ColumnKey("ProcessedGbCount").SummaryOperands(so => { so.SummaryOperand().RowDisplayLabel("Total").Type(SummaryFunction.Sum).Active(true); }); cs.ColumnSetting().ColumnKey("ProcessedItemCount").SummaryOperands(so => { so.SummaryOperand().RowDisplayLabel("Total").Type(SummaryFunction.Sum).Active(true); }); cs.ColumnSetting().ColumnKey("FirstLookGbCount").SummaryOperands(so => { so.SummaryOperand().RowDisplayLabel("Total").Type(SummaryFunction.Sum).Active(true); }); cs.ColumnSetting().ColumnKey("FirstLookItemCount").SummaryOperands(so => { so.SummaryOperand().RowDisplayLabel("Total").Type(SummaryFunction.Sum).Active(true); }); cs.ColumnSetting().ColumnKey("TotalForReviewGBCount").SummaryOperands(so => { so.SummaryOperand().RowDisplayLabel("Total").Type(SummaryFunction.Sum).Active(true); }); cs.ColumnSetting().ColumnKey("TotalForReviewItemCount").SummaryOperands(so => { so.SummaryOperand().RowDisplayLabel("Total").Type(SummaryFunction.Sum).Active(true); });
}) .Type(OpType.Local); features.MultiColumnHeaders(); }) .DataBind() .Render())
Hey Ryan,
They should not appear when you set only the "SUM". Maybe there is something more in your code that causes it. Anyway, I've attached a short sample which you can use as a reference. Also I've added a screenshot showing how it should look like. Please, check them out and maybe you can find what's the difference with your code. You just need to reference the scripts and CSS files in order to run the sample. And if you have any additional questions, you could share some of your code and I'll be happy to help you investigating it.
Thanks for the response. That actually worked this time. I tried it earlier but I must have missed something as it didn't work then.
Only issue I have left is that when I enable the summaries and set it to custom so I can get this, I still see the 4 blank extra rows. Is there a way to eliminate them down to only the one I am using?