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

Editing Custom Editor Demo is not working in my Local Environment

4 Answers 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ahmed
Top achievements
Rank 1
Ahmed asked on 19 Jul 2015, 06:57 PM
I'm trying to use Editing Custom Editor in my local Environment http://demos.telerik.com/aspnet-mvc/grid/editing-custom
But It is not working as it should be and not showing Drop Down List for Category Column in Edit mode and show numeric text box and text box instead
I'm using Northwind Database as in your example and I didn't change a lot in your code but it is not working .. so could you help to fix this issue and make it work as your example.

4 Answers, 1 is accepted

Sort by
0
eo
Top achievements
Rank 1
answered on 21 Jul 2015, 09:05 PM

Hello Ahmed,

There's a crucial part of Telerik's demo that is ​not on display in the webpage you provided and you didn't include in your project: the custom editor template. The category dropdown box works because it was bound to the column using:

.ClientTemplate("#=Category.CategoryName#")

 

The documentation for creating a custom editor template can be found here, there's even a DropDownList example that you can use for guidance.

Also, you can download KendoUI for ASP.NET MVC examples from your Telerik account by logging into their website and navigating to your "Products & Subscriptions". From there, locate "KendoUI for ASP.NET MVC" and select "Browse all product files". Download the "Manual Installation" file and unzip it; you'll find the examples in wrappers\aspnetmvc\Examples.

0
Dimiter Madjarov
Telerik team
answered on 22 Jul 2015, 06:26 AM

Hello Ahmed,

Indeed Eo is correct - The custom editor template seems to be missing. You could check the documentation on how to configure it here.

Regards,
Dimiter Madjarov
Telerik
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
0
Ahmed
Top achievements
Rank 1
answered on 24 Jul 2015, 11:08 PM
Thanks a lot eo and dimiter for your help .. It is working perfect now in edit and delete but I have new problem when I'm trying to Add New Record .. When I press on Add New Record button, a new error appears which is "ReferenceError: Category is not defined" .. I think it is related to the new initialized object for Add mode has null value for Category Object Property in Product Object .. so do you have any solution for this issue ?
0
Dimiter Madjarov
Telerik team
answered on 27 Jul 2015, 11:35 AM

Hello Ahmed,

You should set a default value for the Category field to overcome the issue.
E.g.

.DataSource(dataSource => dataSource
   .Ajax()
   ...
   .Model(model =>
   {
       model.Id(p => p.ProductID);
       model.Field(p => p.ProductID).Editable(false);
       model.Field(p => p.Category).DefaultValue(...);
   })

Regards,
Dimiter Madjarov
Telerik
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
Tags
Grid
Asked by
Ahmed
Top achievements
Rank 1
Answers by
eo
Top achievements
Rank 1
Dimiter Madjarov
Telerik team
Ahmed
Top achievements
Rank 1
Share this question
or