Kendo MVC Grid Numeric Textbox

I try to show numeric text box in grid. My data is int but not showing like demos in telerik. I used client template but at this time grid has two input in same cell.

It is showing like this when I used any attributes for template.

enter image description here

here is code;

 columns.Bound(c => c.MAX_DOSYA_BOYUT)

When I use custom template it is showing like this

enter image description here

here is code;

   columns.Bound(c => c.MAX_DOSYA_BOYUT).Template(@<text></text>).ClientTemplate(

            Html.Kendo().NumericTextBox<int>()
                .Name("order_#=URETIM_YERI#")
                .HtmlAttributes(new { value = "#=MAX_DOSYA_BOYUT #", @class = "k-numerictextbox", style = "width:100%" })
                .Min(0)
                .Max(100000)
                .Step(1)
                .Decimals(0)
                .ToClientTemplate().ToHtmlString());

and it must look like at this link

telerik kendo editing

What i am doing wrong?

Thanks...

Upvotes: 2

Views: 2929

Answers (1)

Przemysław Kleszcz
Przemysław Kleszcz

Reputation: 646

At first, make sure ~Views/Shared/EditorTemplates directory contains predefined kendo ui mvc editor templates. If not - copy them from wrappers/aspnetmvc/ EditorTemplates folder of your kendo ui mvc installation.

Columns binding settings:

columns.Bound(c => c.NumberTest).EditorTemplateName("Integer");

Editor template name "Integer" corresponds with Integer.cshtml template in EditorTemplate directory. Result - fully themed widget.

Upvotes: 2

Related Questions