Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC Bulk Edit - Examples

Ok, so this is an alternative to this question.

I'm trying to produce an MVC application using LinqToSql that allows for bulk editing of data on a single page.

Imagine a simple table Item with ItemId, ItemName, ItemPrice as fields.

There are many examples out there of extrmely simple MVC applications that show you a list of these items with an edit button next to each and an add button at the bottom.

From a UI perspective I find this very time consuming when a lot of data needs entering / updating.

I'm after a single page containing the items names and prices in textboxes that can all be edited in one go and then a single "Save" button pressed to update the data.

I've seen a number of examples that perform various stages of this but have yet to find one that implements the full solution. In particular the interaction with Linq.

I have a number of methods I've tried which all work, however, my gut feeling tells me my methods "smell" and therefore I'd like to see some examples of how other people have attempted this.

So, put simply, my question is can anyone provide some links to some examples please?

like image 567
Robin Day Avatar asked Dec 02 '25 22:12

Robin Day


1 Answers

I have written about how to do this with MvcContrib's FluentHtml. Steve Sanderson has written about how to do it without FluentHtml. Both of our articles have a sample solution you can download and look at.

As far as LinqToSql, I would consider any interaction between bulk editing mechanism (controller and view) and LinqToSql to be a smell. That is to say, as far as possible your UI should be ignorant of your persistence mechanism.

like image 63
Tim Scott Avatar answered Dec 05 '25 15:12

Tim Scott



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!