Do not show decimals in Kendo UI numericTextbox when declaratively binding in template

TheDudeAbides picture TheDudeAbides · Oct 1, 2013 · Viewed 9.1k times · Source

For some reason my numericTextbox is still showing a decimal and numbers after the decimal while in a kendo template. I followed the other answers by having the attributes of decimals="0" and format="#" but to no avail.

code:

<table>
            <tbody>
                # for (var i = 0; i < data.length; i++) { #
                    <tr>                    
                        <td>
                            <input type="number" data-role="numerictextbox" value="#= data[i].Copies #" 
                                decimals="0" format="\\#" min="1" class="copies" style="width:60px;"/>
                        </td>
                    </tr>
                # } #
            </tbody>
        </table>

Answer

Nandha kumar picture Nandha kumar · Dec 28, 2015

Just use the following code:

@(Html.Kendo().NumericTextBox<int>()
.Name("Id") 
.Value(0)
.Decimals(0)
.Format("#"))