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

Dropdown List binding issue inside grid Edit template child grid

3 Answers 200 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
dperish
Top achievements
Rank 1
dperish asked on 13 Jan 2014, 06:24 PM
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

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 15 Jan 2014, 12:13 PM
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!
0
dperish
Top achievements
Rank 1
answered on 16 Jan 2014, 04:25 PM
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

0
Petur Subev
Telerik team
answered on 20 Jan 2014, 03:05 PM
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!
Tags
DropDownList
Asked by
dperish
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
dperish
Top achievements
Rank 1
Share this question
or