在ASP.NET MVC中复制Webforms GridView

时间:2022-04-07 05:26:03

Is there a realistic way to implement a webforms stylegridview in ASP.NET MVC, with inline editing?

有没有一种现实的方法在ASP.NET MVC中实现webforms stylegridview,并使用内联编辑?

I have found various solutions to get a grid with inline editing working in MVC using JQuery add-ins but so far they have been very messy, require an unrealistic amount of work and that all gets worse when you want to add client and server side validations.

我找到了各种解决方案,使用JQuery插件在MVC中使用内联编辑工作,但到目前为止,它们非常混乱,需要不切实际的工作量,并且当您想要添加客户端和服务器端验证时,所有这些都会变得更糟。

I develop a lot of sites that have fairly extensive administration sections to them. So far I have spent longer doing one page with MVC (which still does not work) than I would have doing the whole administration section of a site. Grids with inline editing work really well for somethings, say maintaining a list of countries and marking some as active or inactive. I know I can easily make this open a "details/edit" page, or even handle it with an AJAX popup, but neither of these options provides as clean a user experience as inline editing for things this simple.

我开发了许多具有相当广泛的管理部分的站点。到目前为止,我花了更长的时间与MVC(仍然不起作用)做一个页面,而不是我在网站的整个管理部分。具有内联编辑功能的网格对于某些人来说非常有用,比如维护一个国家/地区列表并将其中一些标记为活动或非活动状态。我知道我可以轻松地将其打开为“详细信息/编辑”页面,甚至可以使用AJAX弹出窗口处理它,但这些选项都没有提供像内联编辑这样简单的用户体验。

Has anyone found an easy way to achieve inline grid editing or do I need to go for a hybrid MVC / winforms site (which I really didn't want to do).

有没有人找到一种简单的方法来实现内联网格编辑,或者我需要去一个混合的MVC / winforms网站(我真的不想这样做)。

Thanks Andrew

2 个解决方案

#1


1  

The Java Script Framework Ext JS has some good support for all different types of grids. This is something you could easily use with ASP .NET MVC, I'm sure there are some other solutions both client and server side out there as well.

Java Script Framework Ext JS对所有不同类型的网格都有一些很好的支持。这是你可以轻松使用ASP .NET MVC的东西,我确信还有其他一些客户端和服务器端的解决方案。

#2


0  

I have had luck with incorporating Dynamic Data with ASP.NET MVC for just this very purpose. This hybrid solution can give you all the perceived benefits of a foward facing MVC site while giving you a quick and easy way to create CRUD functionality on all your data for admnistrative purposes. To be honest, if your user base isn't that large, designing the whole application in Dynamic Data is a legitimate option, especially once you get comfortable enough with it to use it past its basic "scaffolding" abilities.

我很幸运将动态数据与ASP.NET MVC结合在一起就是为了这个目的。这种混合解决方案可以为您提供面向MVC站点的所有感知优势,同时为您提供一种快速简便的方法,可以出于行政目的在所有数据上创建CRUD功能。说实话,如果你的用户群不是那么大,那么在动态数据中设计整个应用程序是一个合法的选择,特别是一旦你足够舒服地使用它超过其基本的“脚手架”能力。

As far as actually finding a packaged solution for providing ASP.NET GridView functionality in ASP.NET MVC, good luck. I have yet to find any solution that doesn't require some sort of melding with javscript frameworks or incomplete solutions like those offered by MVC Contrib. If you do find one, please let me know.

至于实际找到一个在ASP.NET MVC中提供ASP.NET GridView功能的打包解决方案,祝你好运。我还没有找到任何解决方案,不需要与javscript框架或MVC Contrib提供的不完整解决方案进行某种融合。如果你找到了,请告诉我。

#1


1  

The Java Script Framework Ext JS has some good support for all different types of grids. This is something you could easily use with ASP .NET MVC, I'm sure there are some other solutions both client and server side out there as well.

Java Script Framework Ext JS对所有不同类型的网格都有一些很好的支持。这是你可以轻松使用ASP .NET MVC的东西,我确信还有其他一些客户端和服务器端的解决方案。

#2


0  

I have had luck with incorporating Dynamic Data with ASP.NET MVC for just this very purpose. This hybrid solution can give you all the perceived benefits of a foward facing MVC site while giving you a quick and easy way to create CRUD functionality on all your data for admnistrative purposes. To be honest, if your user base isn't that large, designing the whole application in Dynamic Data is a legitimate option, especially once you get comfortable enough with it to use it past its basic "scaffolding" abilities.

我很幸运将动态数据与ASP.NET MVC结合在一起就是为了这个目的。这种混合解决方案可以为您提供面向MVC站点的所有感知优势,同时为您提供一种快速简便的方法,可以出于行政目的在所有数据上创建CRUD功能。说实话,如果你的用户群不是那么大,那么在动态数据中设计整个应用程序是一个合法的选择,特别是一旦你足够舒服地使用它超过其基本的“脚手架”能力。

As far as actually finding a packaged solution for providing ASP.NET GridView functionality in ASP.NET MVC, good luck. I have yet to find any solution that doesn't require some sort of melding with javscript frameworks or incomplete solutions like those offered by MVC Contrib. If you do find one, please let me know.

至于实际找到一个在ASP.NET MVC中提供ASP.NET GridView功能的打包解决方案,祝你好运。我还没有找到任何解决方案,不需要与javscript框架或MVC Contrib提供的不完整解决方案进行某种融合。如果你找到了,请告诉我。