Apply Webgrid Pagination to a table - asp.net-mvc-3

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.

Related

What is the right combination to use Paging and styling in MVC?

I may not be finding the best way to ask this, but I'm learning MVC by trying to build a small website. This is supposed to be a shopping website. Here I am on the part of displaying items on the page. I came through webgrid, but its displaying items in tabular form. Should I learn the tricks of tables like those in html? Because I have heard they can be modified to give any view?
Or can there be other alternatives to webgrid? I really like its Paging feature. I don't think I'm good enough right now to code for that. I have tried some googling and found jqgrid but that also seems to be good for tabular representation of data. I have been trying with this webgrid thing from last night and its really not coming together all good. What else can be the option? I mean something abstract enough to provide me good looks of a shopping website's product page, when I can provide a List of products(the model) from controller to the view? Then what?
Update: Basically I wanna know what part am I missing? Modifying Table to create good views? using webgrid properly? Or am I using the webgrid wrongly? something else should be used in this scene?
You can take a look at this simple of example of how to use Twitter Bootsrap to style a WebGrid: WebMatrix WebGrid – Re-Working the Pager.
You can also check out the Twitter Bootstrap site for examples of other ways this can be used to transform tabular data.

MVC3 Paging - only load the rows in the current page

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.

Dynamic editable table/grid generation with postback in MVC

I need to generate a table in MVC that can have a variable set of horizontal columns (years). I need to render a textbox in each cell and I need to postback the values to a action method. I have seen examples where the editable cells are generated but the columns are fixed (using partials). I have also seen examples where the table can be rendered with dynamic columns but without the editable cells/textboxes. Can anyone suggest an approach?
I would recommend creating the dynamic table with a textbox in each cell with an onchange action to send the data via ajax to the controller for the update.
You will probably need to pass a multidimensional array within the model and use it to create and load your table.
The question is though how are you expecting to handle this on the server side?
If you name them all sequentially and know the # of columns ahead of time the model binder CAN bind to a list for you if they are all named in the appropriate format. Do you want to generate the list from a model or some other method?
Phil Haack covers how the naming format is, although the EditorFor will handle this automatically in some cases. If it doesnt work in yours, simply naming them in this scheme should work.
http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx

Need MVC3 Razor Grid that loads by JSON/AJAX and has frozen columns

I need a grid on an MVC3 Razor page that will have to load by JSON or AJAX call. I need this grid to be editable as well.
Also I need the grid to have the ability to have the first 6-8 columns frozen. I looked at the example on Codeproject.com and I couldnt get it to work. My scrollbars would show up but couldnt get the columns to freeze.
I have been working on this using Telerik grids, but it doesnt have the ability to freeze columns by default in a razor setting.
Does anyone have any suggestions on how to implement this or where I could look for some more information?
Try jQuery EasyUI http://www.jeasyui.com/documentation/datagrid.php
I did initially suggest jqGrid: http://www.trirand.com/blog/
but apparently it's a faff to get frozen columns using it.

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

Resources