Radnumerictextbox align right

33 posts, 0 answers
  1. Gama
    Gama avatar
    18 posts
    Member since:
    Jun 2010

    Posted 21 Jun 2010 Link to this post

    I have the following radnumerictextbox which is behaving oddly

    <telerik:RadNumericTextBox ID="txtAmount" runat="server" TabIndex="23" MaxLength="15" 
         DataType="System.Decimal" Width="50px" AllowOutOfRangeAutoCorrect="False" MaxValue="922337203685477" 
         Type="Currency" EmptyMessage="$" style="text-align:right" EnabledStyle-HorizontalAlign="Right"  /> 
     

    When the page first loads, the textbox is aligned to the left.  As soon as the mouse enters it, it becomes aligned to the right.  How can I make it align to the right when the page first loads?



  2. Gama
    Gama avatar
    18 posts
    Member since:
    Jun 2010

    Posted 21 Jun 2010 Link to this post

    Nevermind.  I got it.  I had to add the RTL style.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. axeuser
    axeuser avatar
    7 posts
    Member since:
    Apr 2007

    Posted 20 Jul 2010 Link to this post

    how did you do it expecificaly?
  5. Carlos Contreras
    Carlos Contreras avatar
    26 posts
    Member since:
    May 2010

    Posted 08 Oct 2010 Link to this post


    Hi axeuser!

    In order to align a RadNumericTextBox to the right, you could do it from it's design, like this:

    <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" AutoPostBack="True" MaxLength="7" MaxValue="21" MinValue="0" OnTextChanged="rntbTipoCambio_TextChanged" Type="Currency" Value="0" Width="63px">
       <EnabledStyle Font-Names="Verdana" HorizontalAlign="Right" />
    </telerik:RadNumericTextBox>

    I hope it helps you.


    Good luck!
  6. Stacy
    Stacy avatar
    98 posts
    Member since:
    Dec 2010

    Posted 20 Jun 2011 Link to this post

    I am getting the same behavior as desribed above, the numbers are left justified but as soon as my mouse hovers over the numeric textbox, they align to the right.  I want them to be right justified all the time.

    I have wrapped the original class to create my own class with this:

    public class WLPNumericTextBox : RadNumericTextBox
       {
           public WLPNumericTextBox()
           {
               Initialize();
           }
     
           private void Initialize()
           {
               EnabledStyle.HorizontalAlign = HorizontalAlign.Right;
           }

    But this seems to have no effect, any ideas?
  7. jsearl
    jsearl avatar
    11 posts
    Member since:
    Jun 2007

    Posted 20 Jun 2011 Link to this post

    I'm having the same issue when using EnabledStyle-HorizontalAlign="Right".  I am only seeing this when using IE9.  It works in previous versions of IE.  I did try what the original poster had described as fixing the problem, which was add the css attribute "direction: rtl;", and this works, but this is a hack.  I don't want to have to do this for every place I have the control right aligned.  Any suggestions for this bug?

    Thanks!
  8. Martin
    Admin
    Martin avatar
    811 posts

    Posted 21 Jun 2011 Link to this post

    Hello Jsearl,

    It looks like the reported problem is IE9 related issue. I have forwarded your report to our developers for further investigation. As a workaround you can set the required alignment with CssClass instead:

    <%@ Page Language="C#" %>
     
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <head id="Head1" runat="server">
        <style type="text/css">
            .MyClass
            {
                text-align:right;
            }
        </style>
    </head>
    <body>
        <form id="mainForm" runat="server">
        <asp:ScriptManager runat="server" ID="ScriptManager1">
        </asp:ScriptManager>
        <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" Type="Currency"
             Value="100" EnabledStyle-CssClass="MyClass" />
        </form>
    </body>
    </html>

    I hope this helps.

    All the best,
    Martin
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  9. Datamex
    Datamex avatar
    161 posts
    Member since:
    Jun 2012

    Posted 18 Dec 2012 Link to this post

    Dear sir/madam,

    I'm using the RadNumericTextBox and it works flawless in Internet Explorer 7 and 8. Google Chrome and even Firefox.
    However in Internet Explorer 9 it will not align the text to the right (unless I run the browser in Compatibility modus)

    I've tried all the following:

    <telerik:RadNumericTextBox ID="TotalAccountBalanceTextbox" runat="server" Type="Currency"
       DbValue='<%# Eval("AccountBalanceTwoYearsBefore")  %>' ReadOnly="true" SkinID="ReadOnlyNumericTextBox"
      Style="text-align:right;">
      <DisabledStyle HorizontalAlign="Right" />
      <EnabledStyle HorizontalAlign="Right" />
      <FocusedStyle HorizontalAlign="Right" />
      <ReadOnlyStyle HorizontalAlign="Right" />
    </telerik:RadNumericTextBox>


    I also modified the SkinID in the .skin file (just for checking)

    <telerik:RadNumericTextBox runat="server" SkinId="ReadOnlyNumericTextBox"
      BackColor="LightYellow"
      style="border-color:#8E8E8E #B8B8B8 #B8B8B8 #8E8E8E; text-align:right !important;"
      DisabledStyle-ForeColor="Black"
      EnabledStyle-HorizontalAlign="Right"
      DisabledStyle-HorizontalAlign="Right"
      ReadOnlyStyle-HorizontalAlign="Right"
       />

    I've tried the style with and without the !important tag but no matter what I try. In IE9 this box does not align to the right.
    When I check the source with the debug viewer (F12) it states 'inline style - text-align:right'.

    Can someone please help me with this issue.. (ow and by the way.. 'Not using IE9 is, sadly, not an option')

    Thank you in advance!


  10. Martin
    Admin
    Martin avatar
    811 posts

    Posted 19 Dec 2012 Link to this post

    Hello,

    As stated in the previous post, this is IE9 only related issue that can be easily workarounded by using custom CSS class. Here is how your code should be modified:

    <style type="text/css">
        .RightAligned
        {
            text-align: right;
        }
    </style>


    <telerik:RadNumericTextBox ID="TotalAccountBalanceTextbox" runat="server" Type="Currency"
        DbValue='<%# Eval("AccountBalanceTwoYearsBefore")  %>' ReadOnly="true" SkinID="ReadOnlyNumericTextBox"
        Style="text-align: right;" CssClass="RightAligned" >
        <DisabledStyle HorizontalAlign="Right" CssClass="RightAligned" />
        <EnabledStyle HorizontalAlign="Right" CssClass="RightAligned" />
        <FocusedStyle HorizontalAlign="Right" CssClass="RightAligned" />
        <ReadOnlyStyle HorizontalAlign="Right" CssClass="RightAligned" />
    </telerik:RadNumericTextBox>

    Note that there is no need to change the skin code.

    I hope this helps.

    Kind regards,
    Martin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  11. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 22 Jan 2014 Link to this post

    Hi ,

    I am using RadNumerictextbox ,but i am not able to remove caution image from my textbox please help me out i dont want caution image in my textbox ,when a user enter wrong value.

    Thanks
    Romi
  12. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Jan 2014 Link to this post

    Hi Romi,

    Please have a look into the sample code snippet to achieve your scenario.

    ASPX:
    <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" ClientEvents-OnError="OnError">
    </telerik:RadNumericTextBox>

    JavaScript:
    <script type="text/javascript">
        function OnError(sender, args) {
          args.set_cancel(true);
        }
    </script>

    Thanks,
    Princy.
  13. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 23 Jan 2014 Link to this post

    Hi,

    Thanks for your reply, It was useful for us .I want to know one thing that ,can I changed button look  and customized it according to our requirement in radnumericTextbox.

    Thanks ,
    Romi

  14. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Jan 2014 Link to this post

    Hi Romi,

    I guess that you want to customize the RadButton style. You can customize the look of the RadButton either by creating  a Custom Skin for Radbutton or customize the Common Styles as per your requirement. Please elaborate your requirement if it doen't help.

    Thanks,
    Princy.
  15. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 24 Jan 2014 Link to this post

    Hi,

    Actually ,I am asking about RadNumericTextbox Up and down default  button,whether i can change or customize  its look according to our application requirement  using some css or new image for that.
  16. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 24 Jan 2014 Link to this post

    Hi Romi,

    You can customize the RadNumericTextBox Button. Please have a look into this help documentation for further information.

    Thanks,
    Princy.
  17. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 24 Jan 2014 Link to this post

    Hi,

    I tried alot but i am not able to change the image (up and down) of radnumerictextbox.Please suggest.
  18. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Jan 2014 Link to this post

    Hi Romi,

    Please have a look into the following code snippet which works fine at my end.

    ASPX:
    <telerik:RadNumericTextBox ID="RadNumericTextBox" runat="server" ShowSpinButtons="True"
        SpinUpCssClass="Upbutton" SpinDownCssClass="Downbutton">
    </telerik:RadNumericTextBox>

    CSS:
    <style type="text/css">
        .Upbutton
        {
            background: url('plus.gif') 0 0 no-repeat !important;
        }
        .Downbutton
        {
            background: url('plus.gif') 0 0 no-repeat !important;
        }
    </style>

    Thanks,
    Princy.
  19. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 27 Jan 2014 in reply to Princy Link to this post

    Thanks ,it was useful for me.And it is working as i want .Thanks alot.
  20. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 28 Jan 2014 in reply to Princy Link to this post

    Hi,

    I am trying to change the image button  of radnumerictextbox ,but it is not working at my end .Their any size  constaint for image .

    code snippet :

    <style type="text/css">
    .riUp Upbutton
    {

    background-image:url('~/Images/Plus.GIF') 0 0 no-repeat !important;
    background-color:Black ;
    border-bottom-color:Black;
    }
    .riDown Downbutton
    {
    background-color:Black ;
    }
    </style>


    <telerik:RadNumericTextBox ID="rntPriority" runat="server" ClientEvents-OnError="OnError" Height="13px" NumberFormat-DecimalDigits="0" Width="50px" IncrementSettings-InterceptArrowKeys="true" IncrementSettings-InterceptMouseWheel="true"
    ShowSpinButtons="true" CssClass="MyEnabledTextBox" SpinUpCssClass="riUp Upbutton" SpinDownCssClass="riDown Downbutton" AutoPostBack="false" ></telerik:RadNumericTextBox>

    please suggest me waht is wrong this .I want to change the border of my image area ,but i am not able to do it.
  21. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 29 Jan 2014 in reply to Romi Link to this post

    Hi,

    Can I changed the back color of up and down button.

    Thanks,
    Romi Varun
  22. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 29 Jan 2014 in reply to Romi Link to this post

    Hi Romi,

    Please try the following CSS which works fine at my end.

    CSS:
    <style type="text/css">
        .riUp
        {
            background:url('plus.gif') 0 0 no-repeat !important;
            background-color:Red !important;
        }
        .riDown
        {
                 
            background-color:Red !important;
        }
    </style>

    Thanks,
    Princy.
  23. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 29 Jan 2014 in reply to Princy Link to this post


    hi,
    Can i place spin buttons inside a textbox.

    Thanks

      

     
  24. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 29 Jan 2014 in reply to Romi Link to this post

    Hi Romi,

    Please try the following CSS to achieve your scenario.

    CSS:
    <style type="text/css">    
    .riUp
    {
       background: url('plus.gif') 0 0 no-repeat !important;
       background-color: Red !important;
       margin-left: -15px !important;
    }
    </style>

    Thanks,
    Princy.
  25. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 04 Feb 2014 in reply to Princy Link to this post

    Hi,

    I have a query related to the radgrid control  .I want to display pager style like below format.

    Records: 1 to 20 of1, 642 Page: 1

    Please suggest.
  26. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 04 Feb 2014 in reply to Romi Link to this post

    Hi Romi,

    You can set the format of the text that appears in the Pager using the PagerTextFormat property.
    Please take a look at this documentation on Using PagerTextFormat to know more about how to set it.

    Thanks,
    Princy
  27. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 05 Feb 2014 in reply to Princy Link to this post

    Hi,

    Thanks for your reply,
    can we grayout the spin buttons when we open numeric textbox as readonly.
  28. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 05 Feb 2014 in reply to Romi Link to this post

    Hi,

    Any suggestion at code behind .

    Thanks
    Romi
  29. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Feb 2014 in reply to Romi Link to this post

    Hi Romi,

    Please have a look into the following code snippet to achieve your scenario.

    JavaScript:
    RadNumericTextBox1.ReadOnly = true;
    RadNumericTextBox1.SpinDownCssClass = "ChangeColor";
    RadNumericTextBox1.SpinUpCssClass = "ChangeColor";  

    CSS:
    <style type="text/css">
        .ChangeColor
        {
            background: url('plus.gif') 0 0 no-repeat !important;
            background-color : Gray !important;
        }
    </style>

    Thanks,
    Princy.
  30. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 10 Feb 2014 in reply to Romi Link to this post

    hi,

    How to implement a paging in Telerik Rad grid without postback.Because I have to implement it on modal popup .Please suggest.


    Thanks
    Romi
  31. Romi
    Romi avatar
    21 posts
    Member since:
    Sep 2012

    Posted 10 Feb 2014 in reply to Princy Link to this post

    Hi,
    I have a question this time regarding Telerik rad grid ,actually i am using modal popup in that modal popup ,using rad grid ,but when i did paging it goes to the base page and when it return to the modal popup there is no data to display.This is happening because when i changed my page there is postback ,but i dont want any kind of postback when i do page change.
    For this i did pagesize="20" and allowpaging= "true".
    Can i do paging without any post back .because this is requirement of my application.I dont want any kind of postback while paging.Because i am not writing any thing on my page index changed.so why there is postback Please suggest me its very urgent.
    Thanks
    Romi
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017