Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET HTML Webmatrix
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 3-Jan-13 7:14am
Edited 3-Jan-13 7:21am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Comments
cs101000 at 5-Jan-13 10:37am
   
Thanks! It was really helpful.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 383
1 Richard Deeming 180
2 Sergey Alexandrovich Kryukov 171
3 Yogesh Kumar Tyagi 165
4 ChauhanAjay 156
0 Sergey Alexandrovich Kryukov 6,252
1 OriginalGriff 5,498
2 CPallini 2,473
3 Richard MacCutchan 1,627
4 Abhinav S 1,530


Advertise | Privacy | Mobile
Web03 | 2.8.140814.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100