Click here to Skip to main content
15,910,886 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i have a table in database in which i have three categories data i.e red, green, yellow
i bind these categories data to different datalists on the basis of category but i want to implement paging on this that controls all of three datalists

can i do this???

please give suggestions
Posted
Comments
Maciej Los 10-Apr-15 5:08am    
What have you tried? Where are you stuck?
Kriti Sharma 10400841 10-Apr-15 5:13am    
i dont understant from where to start

1 solution

The simplest way is to define two variables: currentpageno and recordscountonpage then to call linq query this way:

C#
var qry = DataObjects.Where(d => d.category=="green").Skip(currentpageno * recordscountonpage).Take(recordscountonpage);


Have a look here:
Effective Paging Using LINQ (Sample Code)[^]
Page large result sets with LINQ[^]
Return Or Skip Elements in a Sequence[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900