Search code examples
teleriktag-helpers

set the width of a kendo numeric text box with tag helpers


The title pretty much says it, I have searched the documentation and all I can find is this:

https://docs.telerik.com/aspnet-core/tag-helpers/editors/numerictextbox/overview

Which does not address it at all.

Here is my current line of code:

    <kendo-numerictextbox name="currency" id="txtCheckNumber"  format="#" min="0" enable="true" max="9999999999" spinners="false" value="10001" > </kendo-numerictextbox>

I have tried the obvious width="100px" and width="100" with no success


Solution

  • The only way I could figure out how to set the width was to override the Kendo styles on the wrapper spans and the input.

    <style type="text/css">
        .k-widget.k-numerictextbox {
            width: 100px !important;
        }
        .k-numeric-wrap.k-state-default {
            width: 100px !important;
        }
        .k-numeric-wrap input {
            width: 100px !important;
        }
    </style>