Click here to Skip to main content
15,911,785 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to right align data(numbers) in textfield in ext.net. i tried many ways but helped me. my code is
C#
.style-1 {
      padding-left:75px;
      text-align:right;
      margin-left:75px;
      vertical-align: 75px;
      text-indent:20px;
      direction:rtl;
      background-position:right;
      border-left:'border-width:10px';
     }

<ext:Editor>
 <ext:TextField ID="TextField4"  runat="server" Align="right" Text=" "  PaddingSpec="padding-left:20px;" LabelAlign="Right" TextCls="style-1" LabelCls="style-1" TextAlign="right" NumberAlign="right" CellCls="style-1" ComponentCls="style-1" FieldCls="style-1" InputCls="style-1" IndentLeft="10px" X="10"  />
<ext:Editor/>
Posted
Updated 26-Aug-13 23:46pm
v5

<ext:column id="Column4" dataindex="Amount" header="<CENTER>Amount          <CENTER> " runat="server" width="100" stylespec="font-weight: bold;" align="Right" xmlns:ext="#unknown">


Gives the correct answer for Left alignment of Header and right alignment of Column values.
 
Share this answer
 
<ext:column id="Column4" dataindex="Amount" header="<CENTER>Amount          <CENTER> " runat="server" width="100" stylespec="font-weight: bold;" align="Right" xmlns:ext="#unknown">


This the perfect solution for Header right alignment and Column values left alignment.
 
Share this answer
 
try float right in css.it may work
 
Share this answer
 
Comments
sunitha korakandla 27-Aug-13 5:44am    
It works if the data is in string format but not for numeric values...
sunitha korakandla 27-Aug-13 5:50am    
and also while entering data it is right alignment only but if we save it is again left aligning...
Can you provide a solution to this?
Member 8622273 28-Aug-13 7:00am    
use developer tools and check whether the style is getting overwritten by some other style
sunitha korakandla 10-Sep-13 3:25am    
I am getting right-alignment, this is ok but i want left-alignment for Column header and right alignment for rest of the part.. is that possible.?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900