MVC3 Paging - only load the rows in the current page - asp.net-mvc-3

I want to create a WebGrid like control that would display a gallery (a list of images) that could have many pages. I don't want to load all the rows at the same time that's why I'm unable to use WebGrid and PagedList.
Is there any other alternative to this, taking only a portion of the rows (list.skip(x).take(y))?
Thanks,
czetsuya

See this post in ASP.Net forums
This method uses row wise results from database. This result is fetched according to the pagenumber.

Related

Extensible Asp.net MVC web grids , with the ability to do sort, filter & paging on the database level

Currently I am working on an asp.net mvc 4 web application, and on the index views I have wrote the sorting & paging code manually , which gives me the ability to control how the paging and sorting works. so in my case if I have 10,000 records and the paging size is 50 then only the 50 records will be retrieved from the database, so my current approach can be considered extensible.
But currently I am looking to use web grids because it can save me time and efforts. But I need to know if there are any web grids that have the following main features:-
Provide Ajax-base sort, filter and paging
All the sort, filter and paging need to be done on the database level.
The ability for the users to change the number of records displayed, such as show me 100 records, 200 records , etc
The ability to easily change the look and feel of the web grid.
So can anyone advice on available web grids that have the above 4 main features?
Thanks
I have almost the same requirements for an upcomming project and found Kendoo UI Grid during my research. If you follow the link you will find a demo including the sourcecode.
Some features according to their webpage:
Responsive and Adaptive HTML5 Grid
Page, Sort, Filter or Group Data in ASP.NET MVC Grid
MVC Grid Templates

Apply Webgrid Pagination to a table

My question is simple. MVC3 has a Webgrid Helper which can be used for paging.
Is there a way to use this helper in a table instead of using the webgrid?
Please advise me in this.
The Pager helper needs a WebGrid to work. If you do not want to use the WebGrid, you can create your own paging links. This article explains how, although it is based on the Web Pages framework and shows how to use paragraphs instead of tables: http://www.mikesdotnetting.com/Article/150/Web-Pages-Efficient-Paging-Without-The-WebGrid
However, if you want to display your results in a table, I don't know why you don't use the WebGrid. It renders a table.

ASP.NET MVC WebGrid helper returns whole page on partial update

I created a web grid with ajax updating enabled like this:
var cerradasGrid = new WebGrid(Model.OfertasCerradas, ajaxUpdateContainerId: "ofertas-cerradas");
However when I check the content of the ajax request in firebug the request contains the whole page although the grid updates correctly, it takes time, I have more than one grid on the view, how can I make them return only the grid portion?
When you say that you are seeing the entire page returned, are you referring to sorting or paging? If paging, I believe that all data is fetched on a paged request. You can read this article for more information on efficient paging.
My recent MSDN Magzine article discusses server-side paging and sorting, and partial updates via ajax. Check it out at "Get the Most out of WebGrid in ASP.NET MVC": http://technet.microsoft.com/en-us/query/hh288075

Drupal Views Ajax refresh rows

I have some view (Views 2 - list of invitations, table style) which uses embedded forms to edit records directly in view rows.
I am using ahah to change values in records. What I need is to refresh all records dynamically (some calculations) after I change some checkboxes.
Is there any way to refresh view using Ajax?
To trigger reload table rows only form the code?
I suspect it must be some way (some command) as there is a Use Ajax option in views for sorting tables, etc...
Any hints would be much appreciated
In basic settings there is the 'use ajax' option which :
If set, this view will use an AJAX mechanism for paging, table sorting and exposed filters. This means the entire page will not refresh. It is not recommended that you use this if this view is the main content of the page as it will prevent deep linking to specific pages, but it is very useful for side content.
you may find the module Ajax Views Refresh useful

Efficient gridview in asp.net webforms

Hy guys.
As you know the gridview control is super heavy and reduces performance of the page, as the viewstate length is higher.
I'm trying to get a alternative way to not use default asp.net gridview webforms.
In asp.net mvc we can pass a model for example with Examples[] and in the view iterate over this array and build a
grid and using a number of pages as a anchors than when clicked do a request to a one controller and retrieves json with content of the next 10 tuples in database.
My question is, what is for you guys the best way/more efficient to implement a gridview with paging in webforms?
We use classic AJAX calls and javascript to render and filling the gridVeiew. We are also using the jQuery gridviews now. I am aiming at the reduction of data transfered if we are using a asp:gridview inside a ajax:updatePanel.
Unless you plan to use the fill GridView functionality, I usually prefer rendering the UI out as HTML TABLE using a asp:Repeater control.
HTH.

Resources