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

Grid - Custom Popup Template Editor and DisplayFor

1 Answer 414 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 17 Sep 2014, 01:30 PM
Hi there,

I am running into the same issues as noted on this post when using DisplayFor() on a custom editor template which is called from a Kendo Grid:

Display For Issue

However, we are using our own custom HtmlHelper extension methods which have been built on top of Kendo controls to apply business logic where necessary - one of which is to either render a Kendo DropDownList or a DisplayFor depending on certain business logic.

These controls are used throughout the application - both on normal forms and within Kendo Grid Popups.

The fix in the post above will allow the DisplayFor to display information when on a Kendo Grid Popup - but won't work when the control is used elsewhere. Are there any other approaches which would fix this issue so our generic dropdownlist can be used everywhere - otherwise we would need a different control for when this is used on a Kendo Grid Popup, which would not be desirable.

Failing that, is it possible to dispense altogether with the Kendo Grid popup and instead use a Twitter Bootstrap modal to add / edit grid records?

Thanks,

Paul

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 18 Sep 2014, 11:38 AM
Hello Paul,


This it not an issue, but actually the expected behavior. The Html helpers markup is built on the server side. Since in the current case, the actual value, that will be edited is not yet determined at the time the editor is created (because the data is bound later via Ajax), the default value for the specific type is used instead. This is why the approach demonstrated in the forum post is the only workaround that we could suggest.
Regarding the last question, the current behavior is not related to the exact popup that is used, but to MVC in general.

I hope this information clarifies the scenario.

Regards,
Dimiter Madjarov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or