PDA

View Full Version : linq take() and skip() methods with datastore and paging



Devworks
Mar 05, 2009, 8:55 PM
hi,
i am little confused here, so please clear it out for me.
as i understand the binding between coolite grid and datastore is client side binding, and to get data from linq efficiently you have to use take() and skip() to pull let us say 50 records each time.
now my question is how to let hte grid paging of coolite to connect with linq take() and skip() to pull next 50 records when you reach hte end of the first 50 records in paging ?

thanks in advanced

Devworks
Mar 11, 2009, 6:27 AM
kindly, any help on htis please

Devworks
Mar 20, 2009, 7:33 PM
please any clarification on this ?

geoffrey.mcgill
Mar 20, 2009, 7:42 PM
Maybe the linq samples in following DataController MVC can help. 

Specifically .GetCustomers()

http://code.google.com/p/coolite-mvc/source/browse/trunk/Coolite.Toolkit.MVC/Controllers/DataController.cs



Hope this helps.

Devworks
Mar 20, 2009, 8:19 PM
first thanks a lot for the answering,

though i did not understand fully what is happening because it is MVC and i don't know a jack about it, but from what i understood is that you have to pass the following for return data store

return new AjaxStoreResult(query.Skip(start).Take(1), query.Count());
now i totally understand the query.count param
but where will i be getting the start param from ? and make skip() and take() dynamic and not value of 1 ?
so to be more preciese is how to supply these tow paramters from hte coolite pager ?