Im working on a grid view in asp.net mvc 3 and I need to limit the number of record that will display in my grid(not per page). Is there a way I can do that??. Thanx in advance.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What are you using? Which GridView? It’s really tough to help you whithout any detail information. But anyway, I’ll try…
IMHO I wouldn’t limit the number of records in the view, I would do this on the database query or whereever you get your data!
If you want to set a “JustShowMeXRecords” then put a TextBox or DropDown to your view and give this value to your controller.
If you want to have paging on your grid you can use in example this NuGet Package (http://nuget.org/List/Packages/PagedList). I use it in every project.
It has a static ans dynamic way to get this done.