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

[Solved] Using DisplayFor in Ajax Popup Window

3 Answers 163 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
JDubs
Top achievements
Rank 1
JDubs asked on 24 Jun 2011, 04:13 PM
I have a typed grid that contains a customised template which is used to edit rows of the grid.  The grid uses ajax binding.

I've no problems with the editing, inserting and updating of entries.  My customised template shows the same as the 'auto form' that's created - but improves on the layout.  

A recent change required me adding some Html.DisplayFor entries into the template.  These always get rendered as null and I don't know why.

I've tested this within the telerik demos (Version Q1 2011, released 03/15/2011)  and they have the same problem.  Specifically, I added the template EditableProduct.cshtml to the Shared/EditorTemplates folder of the Razor area.  All this contained was:

@model EditableProduct
 
@Html.DisplayFor(m => m.ProductName)

Then, when I went to the page all I saw was the confirm/cancel buttons.  Can anyone tell me why it's not possible to render this information using DisplayFor.  I've tested that EditorFor works and this does show the expected value.

Cheers.


3 Answers, 1 is accepted

Sort by
0
Neil
Top achievements
Rank 1
answered on 08 Jul 2011, 12:18 AM
JDubs,

Have you figured out why this is occurring or better still, how to display values?  I'm experiencing the same problem - in a popup, DisplayFor() is a no show while EditorFor() is fine.

Thanks,

neil
0
Martin MacPherson
Top achievements
Rank 1
answered on 18 Jan 2012, 12:06 PM
Hi guys, have either of you worked this out yet? Strangely doing @Model.PropertyName doesn't seem to work for me either :(
0
Darren
Top achievements
Rank 1
answered on 17 Apr 2012, 02:01 AM
For anyone still stuck on this, check out the post here:

http://www.telerik.com/community/forums/aspnet-mvc/grid/clajax-databinding-client-editing.aspx#1906385

Cheers,

-Darren
Tags
Grid
Asked by
JDubs
Top achievements
Rank 1
Answers by
Neil
Top achievements
Rank 1
Martin MacPherson
Top achievements
Rank 1
Darren
Top achievements
Rank 1
Share this question
or