Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > NumericTextBox > how to make value as right align

Not answered how to make value as right align

Feed from this thread
  • Ajeesh avatar

    Posted on Jan 31, 2012 (permalink)

    Hi
    How to make value of numeric text box as right align

    Reply

  • Posted on Feb 3, 2012 (permalink)

    I would also like to know how to achieve this.  I have tried:

    Html.Telerik().NumericTextBoxFor(m => m.Units)
              .InputHtmlAttributes(new { style = "text-align: right" })

    It results in a right-alignment when the input has focus but returns to left-aligned when exiting the control.

    Using 2011.3.1115

    Thanks,
    Philip

    Reply

  • Posted on Mar 18, 2012 (permalink)

    Bump:  Is this functionality possible with this control?

    Reply

  • Eric avatar

    Posted on May 18, 2012 (permalink)

    Along with the previously mentioned text-align: right property, adding this css class will produce the desired results:

     

     

     

     

     

    .t-numerictextbox .t-formatted-value
    {
        left: 0;
        right: 0;
    }

    Reply

  • Steven avatar

    Posted on Aug 22, 2012 (permalink)

    You can also do this:
    in your css file add:
    .CurrencyBox
    {
    text-align: right;
    left: 0;
    right: 0;
    }


    then in your view your razor statement is:
    @Html.Telerik().CurrencyTextBoxFor(m => m.Amount).InputHtmlAttributes(new {@class = "CurrencyBox"})
    

    This way you don't have to override any telerik css styles and possibly affect other elements on other pages....






    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > NumericTextBox > how to make value as right align
Related resources for "how to make value as right align"

ASP.NET MVC NumericTextBox Features  |  Documentation  |  Demos  |  Telerik TV ]