Hello,
I have a GridView that uses LinqDataSource. The GridView has default paging enable. I would like to retrieve the data from LinqDataSource before the paging takes place so that I could calculate the Sum of one single column of the whole database using Linq2SQL.
Right now, I'm using LinqDataSource_Selected
event with LinqDataSourceStatusEventArgs.Result
, but it only returns me the data AFTER paging (that is, the data on that page).
protected void linqDataSource_Selected(Object sender, LinqDataSourceStatusEventArgs e)
{
var totalTime = (e.Result as List<Ticket>).Sum(t => t.TimeSpent);
gridView.Columns[8].FooterText = "Sum: " + totalTime;
}
So my question is: How can I retrieve data from LinqDataSource before paging takes place?