Hello,
I'm having a problem obtaining the total row count for items displayed in a Gridview using Paging and with a LinqDataSource as the source of data.
I've tried several approaches:
protected void GridDataSource_Selected(object sender, LinqDataSourceStatusEventArgs e)
{
totalLabel.Text = e.TotalRowCount.ToString();
}
returns -1 every time.
protected void LinqDataSource1_Selected(object sender, LinqDataSourceStatusEventArgs e)
{
System.Collections.Generic.List<country> lst = e.Result as System.Collections.Generic.List<country>;
int count = lst.Count;
}
only gives me the count for the current page, and not the total.
Any other suggestions?
Thank in advance.