This is a migrated thread and some comments may be shown as answers.

How to use aggregatefuncitions to filter some data(just like only make even row number to operate),my code seems wrong?

0 Answers 33 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
PEIYANG
Top achievements
Rank 1
PEIYANG asked on 09 Oct 2012, 03:22 PM
 
At first I write like this,But it can't solve my problem,
column.AggregateFunctions.Add(new AverageFunction
{
FunctionName = "DisplayAverageFunction",
Caption = "Average: ",
ResultFormatString = "{0:n}",
SourceField = FilterSourceField(column.Header.ToString())  where value.Row%2==0 
});
 And I write another code,it still can't  solve my problem
 var avg = new AggregateFunction<student, double>
                {
                    AggregationExpression = myItem =>myItem.Where(i => i.age>=20 && i.row%2==0)
                };
                ((GridViewDataColumn)this.RgvVerify.Columns[0]).AggregateFunctions.Add(avg);

Tags
GridView
Asked by
PEIYANG
Top achievements
Rank 1
Share this question
or