This is a migrated thread and some comments may be shown as answers.
When will usage of DisplayTemplates be supported for Ajax binding?
3 Answers 32 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jana
Top achievements
Rank 1
Jana asked on 19 Jan 2012, 09:27 AM
Dear Telerik-Team,
only a question from my side: When are you planning on supporting usage of DisplayTemplates also for scenarios when we use Ajax Binding - it is hard to live without this powerful feature and it makes me put redundant code in several views...

Thanks a lot for information on this topic. :-)
Best regards,
Jana

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 19 Jan 2012, 09:45 AM
Hello,

Unfortunately implementing support for display templates is not a trivial task. Consider the simplest display template:

@Model

Html.DisplayFor(model => model.Foo) would would render the raw value of the model. This would be a simple string and the grid cannot interpret it any way. There is no way to tell which fields of the bound model are used in the display template and where.

Editor templates are a different story because in most cases an HTML element with "name" attribute matching the name of the bound property is rendered. This allows the grid to find that element and bind it client-side. The following editor template:

@Html.TextBoxFor(model => model)

would render something like

<input name="foo" />

The grid then detects that there is an input whose name is "foo" and binds it to the value of the "foo" property of the model.

Regards,
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
Jana
Top achievements
Rank 1
answered on 19 Jan 2012, 12:57 PM
Hi Atanas,

thanks for the explanation. So does that mean it will never be implemented due to technical restrictions? Documentation states that usage of DT is 'currently' not available with ajax binding, which of course leaves one with the hope it will be possible sooner or later. :-)

Thanks and best regards,
Jana
0
Atanas Korchev
Telerik team
answered on 23 Jan 2012, 08:38 AM
Hello,

 It will be supported if we find a way to implement that. So far however we haven't found one. Perhaps we should update the documentation to and remove the "currently" to avoid any confusion.

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
Tags
Grid
Asked by
Jana
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Jana
Top achievements
Rank 1
Share this question
or