Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to organize contents of a table to be displayed in multiple pages? Consider you have a table with 100 rows and you want to view 10 rows at a time (Like the way that several Email messages are organized in pages). Do we have a special data structure for this? And how can I add filters to manage it better?
Posted
Updated 3-Jan-13 7:21am
v2

The most used way to display data in tabular format from a database in WebMatrix is the WebGrid helper.
It offers a wide variety of options for sorting and paging the rows displayed and supports asynchronously updating the grid content using AJAX.
For a complete class reference look at WebGrid Class[^].
Maybe, the best place for in-depth WebGrid tutorials is the Mike Brind's site[^].
Start with Looking At The WebMatrix WebGrid[^] and then search for more advanced articles.
 
Share this answer
 
Comments
cs101000 5-Jan-13 10:37am    
Thanks! It was really helpful.
It looks like what you really need is proper layout CSS styles and, no wonder… proper paging.

There is a number of CodeProject article on this topic which can help you. Please see:
Paging of Large Resultsets in ASP.NET[^],
ASP.NET Pagination[^].

Actually, there a a lot more to look at: http://www.codeproject.com/search.aspx?doctypeid=1&q=%22ASP.NET%22+table+%28paging+OR+pagination%29[^].

Assuming you don't have too many columns, CSS styles can ensure you use all available page width and effectively arrange columns, while paging will be responsible for vertical dimension and control navigation by ranges of rows.

Good luck,
—SA
 
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