Custom View Paging Problems

Sep 22, 2010 at 7:46 PM

I've created a simple Custom View (vRequestList) to flatten out some of my objects for presentation in a GridView.  The view itself works fine, I can retreive the entire collection fine.  But I'm having problems when I try to get the view results in a sorted and paged fashion.  First and foremost, the stored procedure to the retreive the paged results does not seem to be getting generated (gen_vRequestListPagingSelect).  This stored procedure is however mentioned in vRequestList.Generated.cs in the override for StoredProcedureName.  Do I have to do something special in the model to have this stored procedure generated?

Additionally, is there some technical reason using NHDAL, why views seem to have to be paged in a completely different fashion than regular objects/tables?  To retrevie my request objects in a paged fashion I can do this (basically taken from your page on paging):

RequestPaging paging = new RequestPaging(2, 10, (Request.FieldNameConstants)Enum.Parse(typeof(Request.FieldNameConstants), "RequestName"), true)
IList<Request> reqCol = RequestCollection.RunSelect(x => true, paging).ToList();
gvRequests.DataSource = reqCol;

The Enum parsing is needed becuase the sort columns come in as strings.  Where RunSelect method can take a paging object, however the only way I've seemed to find to page view results has to use subdomains (of course I haven't got this to work yet, becuase of the missing stored procedure).  Something like this:

SubDomain subDomain new SubDomain();
subDomain.AddSelectComand(new vRequestListPagedSelect(2, 10, "RequestName", true, "");
vRequestListCollection reqCol = subDomain.GetCollection<vRequestListCollection>();
gvRequestsView.DataSource = reqCol;
Assuming the problem with the missing stored procedure can be resolved, is there some way to do this with a paging object?  Not that it really matters, if the above will work, just curious?  Thanks.
Oct 4, 2010 at 2:45 PM

Any updates?  Has anybody been able to confirm or deny that this missing generated view paging select stored procedure is a bug?  Do you require any additional info from me?  Thanks!

Oct 5, 2010 at 7:09 PM

Sorry about the delayed response. We have been having issues with our server as of recent. Enough of that though lets get to the problem.


We have reviewed the view implementation and there is currently no way to actually page a view.  You are correct about half of the code is there. Don't know why this was not finished out it was several years back. I am currently looking into finishing it out. I will update you on status as I move forward



Oct 6, 2010 at 2:28 PM

Thanks for the response and your efforts.  Please do update me when paging views becomes available.

Nov 20, 2010 at 6:07 PM

This has been fixed and will be in the next deployed version