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

How do I make RadNumericTextBox print right aligned?

4 Answers 237 Views
Input
This is a migrated thread and some comments may be shown as answers.
Lenny_shp
Top achievements
Rank 2
Lenny_shp asked on 28 Oct 2008, 08:41 PM
It displays right aligned, but when printing via post-back it loses right alignment.

    Protected Sub btnPrint_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPrint.Click
        Page.ClientScript.RegisterStartupScript(Me.GetType(), "PrintForm", "printWindow();", True)
    End Sub






                            <telerik:RadNumericTextBox ID="txtCostSeminar" Runat="server" EnabledStyle-HorizontalAlign="Right"
                                Culture="English (United States)" Skin="WebBlue" Type="Currency" BorderStyle="None"
                                Width="80px" AutoPostBack="True" Value="0" MinValue="0">
                            </telerik:RadNumericTextBox>

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 30 Oct 2008, 04:33 PM
Hi Lenny,

Inline styles are applied to RadInput controls client-side with Javascript. Please use a CSS class instead of an inline style, in order to be able to print with the custom style applied:


ASPX

<telerik:RadNumericTextBox CssClass="AlignRight" />


CSS

.AlignRight
{
   text-align:right;
}



Greetings,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mike
Top achievements
Rank 1
answered on 16 Jan 2009, 02:25 PM
I would also like to change the font-size and this is not working in the RadNumericTextBox, what am I doing wrong?

.AlignRight
{
   text-align:right;
   font-size: 8pt; 

 

}
0
Dimo
Telerik team
answered on 16 Jan 2009, 02:59 PM
Hi Mike,

The font-size is defined in the RadTextBox skin with a specificity of 22. You need to use a rule with higher specificity or use "!important".

http://blogs.telerik.com/dimodimov/posts/08-06-17/How_To_Override_Styles_in_a_RadControl_for_ASP_NET_AJAX_Embedded_Skin.aspx

For example this CSS selector has a specificity of 23:

html body form .RadInput_Vista .AlignRight
{

}


Best wishes,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mike
Top achievements
Rank 1
answered on 16 Jan 2009, 04:01 PM
I am not going to fight it anymore and just use the following tags which work.

EnabledStyle-Font-Size="8pt" 
EnabledStyle-HorizontalAlign="Right"
EnabledStyle-Font-Names="Arial"
FocusedStyle-Font-Size="8pt"
InvalidStyle-Font-Size="8pt"

 

 

 

 

 

 

 

 

 

 

Tags
Input
Asked by
Lenny_shp
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Mike
Top achievements
Rank 1
Share this question
or