ASP.NET MVC的网格显示解决方案 [英] ASP.NET MVC Grid Display solutions

查看:145
本文介绍了ASP.NET MVC的网格显示解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有一些解决问题的对策。我期待的建议在一个优雅的方式来解决的几个问题。

I realize there are several solutions to this problem. I am looking for advice on an elegant way to solve a few issues..

我使用实体框架为我的模式。

I am using Entity Framework for my model.

我需要显示分页数据表和排序作为最小的功能。

I need to display tables of data with paging and sorting as minimum functionality.

切换到MVC之前,在WebForms的,我是jQuery的数据表的忠实粉丝plugin..and我用这个,一起成功,一起定制解析器类来处理页面的排序和筛选。我现在已经使用这种方法与EF碰到一个问题

Before switching to MVC, in WebForms, I was a big fan of the jQuery Datatables plugin..and I used this, with success, alongside a custom parser class to handle paging sorting and filtering. I have now run into a problem using this method with EF

我的问题是,是否有preferred方法来处理网格在MVC与分页和排序功能...

My question is, is there a preferred method to handle Grids in MVC with paging and sorting functionality...

到目前为止,我知道下面可能的解决方案:

So far I am aware of the following possible solutions:


  1. 的jQuery插件数据表有一些更多的自定义分析器的工作(我需要一些帮助与这个方向是正确的入门)

  1. jQuery Datatables plugin with some more custom parser work(I would need some help getting started in the right direction with this)

的jqGrid ..我明白,有一个开源版本以及付费版本,其中似乎包括了MVC中的服务器端解决方案

jqGrid..I understand that there is an open source version as well as a paid version which seems to include a server side solution for MVC

MVCContrib网 ...我不知道很多关于这一点,我甚至不知道这仍是一个接受的解决方案。

MVCContrib Grid...I dont know much about this and I am not even sure if this is still an accepted solution.

Telerik的MVC控制(如下答案的建议)...似乎是最流行的选择到目前为止...

Telerik MVC Controls (as suggested in answers below)...seems to be the most popular choice so far...

我主要关心的是可重用性。我想足够灵活地处理任何模型/视图模型我通过在定制code的最低量的解决方案。我经常碰到的情况下,我需要只显示特定模型的一些属性还是需要显示来自相关类的属性(即Product.ProductName,Product.ProductCategory.CategoryName)

My main concern is reusability. I would like a solution flexible enough to handle any model/viewmodel I pass in with a minimum amount of custom code. I often run into a situation where I need to display only a few properties of a particular model or need to display properties from a related class(I.E Product.ProductName, Product.ProductCategory.CategoryName)

任何帮助或建议将是非常美联社preciated。

Any help or advice would be much appreciated.

修改

我决定尝试一下Telerik的MVC网格现在。我有很高的期望在的jQuery-UI电网这是目前正在开发中。我希望会有ASP.NET MVC考虑MS是赞助商的支持。我从jQuery网站收集的是,他们的网格控件将通过最流行的网格控件的所有最好的方面,包括上面提到的那些得到启发。手指交叉...

I have decided to try out the Telerik MVC Grid for now. I have high hopes for the jQuery-UI Grid that is currently in development. I hope there will be support for ASP.NET MVC considering MS is a sponsor. What I gather from the jQuery site is that their Grid control will be inspired by all the best aspects of the most popular grid controls, including the ones mentioned above. Fingers crossed...

推荐答案

我想借此在Telerik的MVC开源组件好好看看。

I would take a good look at the Telerik MVC open source components.

Telerik的演示

如果您绑定您的网格来的IQueryable你也得到分页,排序,过滤,分组直开箱。他们的编辑器组件为pretty冷静为好。

If you bind your grids to IQueryable you also get paging, sorting, filtering and grouping straight out of the box. Their editor component is pretty cool as well.

这篇关于ASP.NET MVC的网格显示解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆