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

how to make value as right align

4 Answers 226 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ajeesh
Top achievements
Rank 1
Ajeesh asked on 31 Jan 2012, 09:05 AM
Hi
How to make value of numeric text box as right align

4 Answers, 1 is accepted

Sort by
0
Philip Fourie
Top achievements
Rank 1
answered on 03 Feb 2012, 08:00 PM
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
0
Philip Fourie
Top achievements
Rank 1
answered on 18 Mar 2012, 07:52 AM
Bump:  Is this functionality possible with this control?
0
Eric
Top achievements
Rank 1
answered on 18 May 2012, 06:15 PM
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;
}

0
Steven
Top achievements
Rank 1
answered on 22 Aug 2012, 08:54 PM
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....






Tags
NumericTextBox
Asked by
Ajeesh
Top achievements
Rank 1
Answers by
Philip Fourie
Top achievements
Rank 1
Eric
Top achievements
Rank 1
Steven
Top achievements
Rank 1
Share this question
or