Dropdown with ValueTemplate not functioning when used in a grid editor popup.

2 posts, 0 answers
  1. Michael
    Michael avatar
    11 posts
    Member since:
    Sep 2015

    Posted 22 Sep 2016 Link to this post

    Version - 2016.3.914

    I am experiencing a problem getting DDL with templates to render properly when used in an editor template, from a grid.

    Example :


    public class WeightUnit
        public byte ID { get; set; }
        public string Code { get; set; }
        public string Description { get; set; }

    Controller action

    public ActionResult WeightUnits_Read([DataSourceRequest]DataSourceRequest request)
        IEnumerable<Inflight.ServiceModel.WeightUnit> results = svc.ListWeightUnits();
        return Json(results.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);

    Code section in View

    <div id="weights" class="panel-group" style="padding-left:5px;">
           @Html.Label("Unit", new { style = "width:80px;" })
                   .DataSource(source =>
                       .Transport(transport =>
                           transport.Read("WeightUnits_Read", "Utility");
                       .Schema(schema =>
                    .ValueTemplate("#: data.Code # - #: data.Description #")


    When used in an EditorTemplate for adding/editing a record to a grid, the selected value is rendered as ' - undefined'

    The exact same code  works perfectly well in a basic view.

    Am I doing something wrong ?  I assumed that templates could be used in any scenario.



  2. Viktor Tachev
    Viktor Tachev avatar
    1768 posts

    Posted 27 Sep 2016 Link to this post

    Hi Michael,

    Please examine the following resources that describe how you can setup an editor template in the Grid component. Follow the steps in the article and you should be able to implement the behavior you are looking for.

    Viktor Tachev
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top