public static double Avg(ReoGridControl ctrl, ReoGridRange range) { double val = 0; int count = 0; ctrl.IterateCells(range, (row, col, cell) => { if (cell != null && ScriptRunningMachine.IsNumber(cell.Data)) { val += ScriptRunningMachine.GetDoubleValue(cell.Data); count++; } return true; }); return val / count; }
public static double Count(ReoGridControl ctrl, ReoGridRange range) { int count = 0; ctrl.IterateCells(range, (row, col, cell) => { count++; return true; }); return count; }