MVC seriously misses the functionality of Dynamic Data equivalent. Functionality to have it is in place (EditorFor and DisplayFor mechanisms), but the templates are just plain missing.
Your controls for MVC are the best in the business (as you know). Making the right DisplayFor and EditorFor templates which include them and handle things like Foreign key editing (which your controls are great for), would finally make work with MVC productive.
So please please...with a BIG PLEASE...can you build it and ship it with your product?
Would that be possible?
5 Answers, 1 is accepted
We are not sure what your request is. Telerik Extensions for ASP.NET MVC support Display and Editor templates for a long time. For example the Telerik Grid for MVC relies entirely on editor templates for its editing feature and the columns are rendered using DisplayFor. We also ship a set of editor templates for editing various data types - dates, numbers, currency etc. Could you please clarify what you mean?All the best,
the Telerik team
There is no Editor for a simple text box.
For example when i render a DateTimePicker the picker gets a fancy boarder etc. but EditorFor<string>() will be in the browser default style.
I suppose this is only a question of which styles are applied onto the TextBox that gets rendered for the string.
And for that there should be a template. Maybe there is i didn't took the time my self to look for it yet.
Actually I meant something more complete...like EditorFor for complex objects (entities for example...but which includes everything needed to make it...so prefetching relations, showing appropriate editors for relations...checkbox lists for multiple, dropdowns for one parts...all your controls support this, it's just a matter of making it click).
I've since then investigated alternatives, and finally today with MVC Scaffolding even a complete package is possible. It would be great in today's standards is an MVC scaffolding package which includes your controls and your EditorFor/DisplayFor templates, and a way to create CRUD for entites which have all your great editor controls (like date editor, number editors and such), but also which includes functionality to edit relations out of the box like one-to-many, or even many-to-many.
It would be really great to be able to make a scaffolded UI where you can chose to show your grid with some additional filters on top, where you can chose to have list as your grid, edit inline, edit in popup, edit in also generated edit control. And that the logic in behind via attributes on entities properties (exactly how the Dynamic Data works) assembles your great controls to do it (with relations and everything).
So a really complete solution.
I can only hope for such thing, as it would be the missing stone in productivity and MVC,
@Vladan a very good suggestion indeed!
I logged this item in our ToDo list and we will consider it when planning the next major release. To my regret we are not able to start working on the implementation of that kind of templates right now, though a very exciting task.
the Telerik team
If you apply the correct metadata to you model you can do exactly what you want, with the normal template system. You only need to fill the ModelMetadata.AdditionalValues with your One-to-One or Many-to-Many information, and maybe a UiHintAttribute to select another template.
In the template you can then use this information to setup the control as you want.
In my opinion it's pretty hard to find a general solution for every use case, and why should there be one if mvc already allows for such a modification.
If you wan't some additional information on this let me know, because i already did that, based on a completly dynamic model. e.g. which can be changed at runtime.