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

Editor template for double

4 Answers 64 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Iron
Veteran
Dan asked on 07 Sep 2018, 06:23 AM

The telerik for asp.NET Core comes with some EditorTemplates and one of them is Number.cshtml.

I have used the following code <div class="col">@Html.EditorFor(m => m.MeasurementMin)</div> however the generated code is using the String.cshtml template. 

When is the template Number.cshtml used? How should the name for the editor template for double be named?

4 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 11 Sep 2018, 02:03 PM
Hello Dan,

To instruct the Grid to use a specific editor for a field, you should set it explicitly.

You can either use the UIHint attribute in the model:
[UIHint("Number")] // the string should match the name of the file containing the custom editor
public double? Freight
{
    get;
    set;
}

or assign the editor to the column directly:
columns.Bound(p => p.Freight).EditorTemplateName("Number");


Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Dan
Top achievements
Rank 1
Iron
Veteran
answered on 12 Sep 2018, 06:22 AM

Hi,

I forgot I even placed this question. Anyway I tried to rename the Number.cshtml to Double and it worked. Perhaps the String.cshtml template should be renamed so that its not used as default since these templates are custom and should be used in Grid using the solutions you proposed.

Is there a documentation about those templates, because a colleague of mine has placed in the solution all the templates since they came with the telerik and it seems that most of them are not even used by our application.

 

0
Tsvetina
Telerik team
answered on 13 Sep 2018, 03:08 PM
Hello Dan,

There is a mention of the templates in the ASP.NET MVC docs here, but not a full description about their usage:
How to use Kendo UI widgets as editors for dates and numbers?

and a brief mention in the description of the ASP.NET Core installation directory here: Distribution Contents.
I logged a suggestion for adding description of the ready-to-use editor templates and their usage to both documentation sites (ASP.NET MVC and Core).

With regard to the slower response time, it is possible to wait longer for replies in the forums. It is indeed more useful for the community to discuss problems in the forums and we appreciate when customers use them. However, should you have a problem which resolution is time sensitive, it is best to open a support ticket, as tickets are treated with higher priority and get replies faster.

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Dan
Top achievements
Rank 1
Iron
Veteran
answered on 14 Sep 2018, 05:46 AM

Hi Tsvetina,

Thank you for the logging of the suggestion. Indeed in the FAQ it says: "To use these editor templates in your application, copy all files from the corresponding folder " so I'm guessing that my colleague has read this and has done as it says.

Tags
General Discussions
Asked by
Dan
Top achievements
Rank 1
Iron
Veteran
Answers by
Tsvetina
Telerik team
Dan
Top achievements
Rank 1
Iron
Veteran
Share this question
or