Archive For August 2011

The WebGrid - Efficient Paging And Sorting With SQL CE 4.0

calendar_today 28 August 2011 22:46

ASP.NET Web Pages WebMatrix Razor WebGrid

A problem inherent in the existing version of the WebGrid is that it is not very efficient when it comes to paging data out of the box. If you have 10,000 rows of data, and you want to display 10 rows per page, all 10,000 rows are retrieved from the database for each page. The grid works out how to only show the current 10, and wastes the other 9,990 rows. That's a fair sized overhead on each page. Ideally, you should only retrieve the data you need for each page. This article examines how you can do that with the existing WebGrid and a SQL CE database, while still maintaining sorting capabilities.

Displaying Search Results In A WebGrid

calendar_today 27 August 2011 16:57

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

A number of people have run into problems when trying to combine a search or filter form, and a WebGrid. The main issue that arises is when paging or sorting the search result or a filtered subset of it. Here, I look at the cause of the problem and what you can do about it.

How To Maintain Scroll Position When Paging Or Sorting A WebGrid

calendar_today 23 August 2011 21:13

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

This snippet is one in a series showing how to use jQuery to enhance the behaviour of a Web Pages WebGrid. This example shows how to maintain scroll position on the page when paging or sorting the WebGrid.

How To Make A WebGrid Row Clickable

calendar_today 23 August 2011 11:23

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

This snippet is one in a series showing how to use jQuery to enhance the behaviour of a Web Pages WebGrid. This example shows how to make an entire row clickable so that the user is taken to another page that displays details of the selected row.

jQuery Autocomplete with Razor Web Pages and a SQL CE Database

calendar_today 16 August 2011 09:23

jQuery ASP.NET Web Pages WebMatrix Razor

There are a number of autocomplete solutions for jQuery, including the widget that comes as part of the jQuery UI library. This article looks at incorporating the jQuery UI Autocomplete widget into a Razor-based ASP.NET Web Pages site.

WebMatrix and jQuery Forms Part 2 - Editing Data

calendar_today 06 August 2011 17:33

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

This article continues on from one I wrote a while ago, showing how to use jQuery to create a data entry form in conjunction with the WebGrid. The original article prompted a number of requests to show how to extend the example to provide editing functions, and now I have found some time to answer those requests.