Grid - Custom Popup Template Editor and DisplayFor

2 posts, 0 answers
  1. Paul
    Paul avatar
    33 posts
    Member since:
    Mar 2013

    Posted 17 Sep 2014 Link to this post

    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
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2310 posts

    Posted 18 Sep 2014 Link to this post

    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.

     
Back to Top