开发者

Limiting the number of records in a grid view

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 g开发者_StackOverflow中文版rid(not per page). Is there a way I can do that??. Thanx in advance.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜