protected override DataSourceSelectArguments CreateDataSourceSelectArguments ()
{
DataSourceSelectArguments arg = DataSourceSelectArguments.Empty;
DataSourceView view= GetData();
if (AllowPaging && view.CanPage) {
arg.StartRowIndex = PageIndex * PageSize;
if (view.CanRetrieveTotalRowCount) {
arg.RetrieveTotalRowCount = true;
arg.MaximumRows = PageSize;
}
else {
arg.MaximumRows = -1;
}
}
if (IsBoundUsingDataSourceID && !String.IsNullOrEmpty (sortExpression)) {
if (sortDirection == SortDirection.Ascending)
arg.SortExpression = sortExpression;
else
arg.SortExpression = sortExpression + " DESC";
}
return arg;
}