Dropdown List binding issue inside grid Edit template child grid

4 posts, 0 answers
  1. dperish
    dperish avatar
    9 posts
    Member since:
    Aug 2007

    Posted 13 Jan 2014 Link to this post

    Hi,

    I have a Kendo UI grid. On its Edit mode I have implemented Template file. That template file consist of text box, label and  Grid.
    And in Edit template grid, I required to bind dropdownlist.  I have created dropdownlist template for it.

    My issue is instead of allowing inline edit It display javascript on the page. It gives javascript error "Unterminated string constant" if I run it in Internet Explorer.

    Please find sample project for the issue.

    Regards,
    Anand
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 15 Jan 2014 Link to this post

    Hello David,

    Thank you for sending the sample project.

    Inside the custom popup template any special symbols should be escaped. This is done automatically if you use the ToClientTemplate method of any widget. In your case the Grid widget.

    e.g.

    @(Html.Kendo().Grid<EmployeeViewModel>()
                       .Name("editgrid")
                       .Editable(editable => editable.Mode(GridEditMode.InLine))
                       .DataSource(ds => ds
                           .Ajax()
                           .Batch(true)
                           .Read(read => read.Action("Read", "Home"))
                           .Update(update => update.Action("Update", "Home"))
                           .Model(m =>
                           {
                               m.Id(subs => subs.EmployeeID);
                           })
                           .PageSize(10)
                           .ServerOperation(true)
                           )
                       .Columns(columns =>
                       {
                           //columns.Bound(subs => subs.CoverageType.Name).Width("30%").Title("Coverage");
                           columns.Bound(subs => subs.FirstName).Title("First Name");
                           columns.Bound(subs => subs.FirstName).Title("Last Name");
                           columns.Bound(subs => subs.Salary).EditorTemplateName("SalaryRange").Title("Salary Range");
                       })
                       .Navigatable()
                      .ToClientTemplate()
                   //.ToolBar(toolBar => toolBar.Create())
                   )


    Kind Regards,
    Petur Subev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. dperish
    dperish avatar
    9 posts
    Member since:
    Aug 2007

    Posted 16 Jan 2014 Link to this post

    Hi,

    Thanks for help solving issue real quick. However I have one another issue with the drop down inside popup grid. Attaching sample project.
    It is having pop Grid in InCell mode. It is having column called Salary Range. On click of any of the cell it displays drop down. 
    My issue is drop down selected item doesn't set the cell value and reset it to 0.

    Regards

  5. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 20 Jan 2014 Link to this post

    Hello David,

    Basically the case is the same as the one covered here. You should name the editor the same way as the property. 

    For your case it should be:

    @(Html.Kendo().DropDownList()
             .Name("Salary")


    Kind Regards,
    Petur Subev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready