I have a csladatasource pointing to a readOnlyListBase object. While it binds fine unlike the other datasource controls there is no way to specify the RecordCount method. I have implemented the IReportTotalRowCount interface on my business object but the TotalRowCount property is never called.
I would think given the obvious need to not load every record at once the answer is simple but currently I've had no luck finding any explanation on how IReportTotalRowCount is supposed to work and as a result my gridview thinks the total row count is how many items I returned from my query.
Any suggests would be appreciated.
thanks.
The basic approach is to take the arguments object passed into the select method from data binding, and pass some or all of that information through your criteria object to the DataPortal_Fetch() method so you can do the sorting/filtering/paging at the database level.
When you do this, it is your responsibility, in the factory method, to report the total row count, and provide a paged subset of the overall data.
Full coverage of sorting/filtering/paging is in the CSLA .NET Version 2.1 Handbook ebook from http://store.lhotka.net. But you need a factory method something like this:
public static MyList GetPage(Csla.Web.SelectObjectArgs args)
{
return DataPortal.Fetch<MyList>(new SingleCriteria<MyList, Csla.Web.SelectObjectArgs)(args));
}
Copyright (c) Marimer LLC