Hi guys.
I have a grid and at the bottom there is a sum of 1 column.
Is there any way that I can do to ignore some rows?
For example, I want to ignore the row that with 'Waste' text.
Hello engloon,
If I got you right I believe that you could try out the following code sample and see if it meets your requirements:
public class SummaryCalculator : ICustomSummaryCalculator { private double total = 0; double notNeeded; public void AggregateCustomSummary(SummarySettings settings, UltraGridRow row) { notNeeded = 0; if (row.Cells["Column 1"].Text == "Waste") { notNeeded += Convert.ToInt16(row.Cells["Column 0"].Value); } else total += Convert.ToInt16(row.Cells["Column 0"].Value); Console.WriteLine("NotNeed: " + notNeeded.ToString() + " Total: " + Convert.ToInt16(row.Cells["Column 0"].Value)); } public void BeginCustomSummary(SummarySettings settings, RowsCollection rows) { this.total = 0; } public object EndCustomSummary(SummarySettings settings, RowsCollection rows) { return this.total - notNeeded; } }
Please feel free to let me know if I misunderstood you or if you have any other questions.
Hi Boris.
I found out what was the problem.
Thanks a lot for your help :)