This is a migrated thread and some comments may be shown as answers.

When can we hope for EditorFor and DisplayFor templates?

5 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
vladan strigo
Top achievements
Rank 1
vladan strigo asked on 29 Dec 2011, 03:31 PM
Wishes for the new year...

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?



Kind regards,
Vladan

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 29 Dec 2011, 04:09 PM
Hello,

 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,
Atanas Korchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Florian
Top achievements
Rank 1
answered on 09 Jan 2012, 08:32 AM
I guess, he means for simple data like string.
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.
0
vladan strigo
Top achievements
Rank 1
answered on 16 Jan 2012, 11:29 AM
Sorry for not responding earlier.

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,


0
Erjan Gavalji
Telerik team
answered on 18 Jan 2012, 04:21 PM
Hi guys,

@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.

Thanks,
Erjan Gavalji
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Florian
Top achievements
Rank 1
answered on 18 Jan 2012, 04:46 PM
@Vladen, if you want to make it really dynamic, i would suggest to use EditorForModel.

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.
Tags
General Discussions
Asked by
vladan strigo
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Florian
Top achievements
Rank 1
vladan strigo
Top achievements
Rank 1
Erjan Gavalji
Telerik team
Share this question
or