I have an ASP.NET Dynamic Data 4 web app based on the "ASP.NET Dynamic Data Domain Service Web Application" template.
A key user requirement is that the user can choose to edit multiple rows and then submit the bulk to the database for updating. The rows would be highlighted according to their underlying object state. For example, "Added" would be green, "Deleted" would be red, and "Modified" would be yellow. I'm not so interested in batch updates as I am in being able to have more t开发者_运维知识库han one object in an edit state simultaneously. The user can click a master "Save" button and have all changes sent to the database, or can cancel and have all changes rolled back.
As far as I have been able to determine after extensive and frustrating searching, is that this is not a scenario that is possible using Dynamic Data.
Has anyone been able to achieve this behaviour and if so, could you please point me in the right direction to figure out how to do it.
Thanks, Alex.
ASP.NET dynamic data is API to build very quickly simple data driven web application. But the quickness is exchanged with flexibility. This is not possible with Dynamic data as I know (I used only version in .NET 3.5 + futures project so I'm not sure how much this changed in .NET 4.0).
The problem is that dynamic data are based on databinding directly to EF and autogenerating fields and columns based on retrieved entities. Each executed change is directly executed in EF = in DB. Your requirement demands that you keep data in the session and execute changes only if user triggers the save button. That require another layer in your application and using other way to bind data. You will either need ObjectDataSource
or custom binding. I'm not sure how this will play with "dynamic" nature of the application. You can easily end up writing separate code for each entity type which have to support this.
I have the same need, only I do not need to update multiple tables. It is a little late for you perhaps, but I found this web page to read. My page is just beginning its development.
http://msdn.microsoft.com/en-us/library/aa992036(v=vs.100).aspx
Todd
精彩评论