Messed up RadNumericTextbox Display?

3 posts, 1 answers
  1. Dan
    Dan avatar
    124 posts
    Member since:
    Feb 2011

    Posted 12 Apr 2012 Link to this post

    I am trying to set the text color of a Read-Only NumericTexbox - in the code below.

    With my first CSS Class, the font color is not assigned.  When I add "!important" in the second one, I end up seeing strange additional text that should not be visible.  

    Am I doing this wrong or is this a bug?  

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Numeric_Bug.aspx.vb" Inherits="Elan.Web.Numeric_Bug" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head id="Head1" runat="server">
        <title></title>
        <style type="text/css">
            .disabledNumericTextbox
            {
                color: Red;
            }
            .disabledNumericTextboxBroken
            {
                color: Red !important;
            }
        </style>
    </head>
    <body>
        <form runat="server" id="form1">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <div style="padding: 50px; border: 1px solid #ccc">
            <telerik:RadNumericTextBox runat="server" ID="RadNumericTextBox3" ReadOnly="true"
                ReadOnlyStyle-CssClass="disabledNumericTextbox" NumberFormat-DecimalDigits="2"
                Value="80000.85" Width="110" ReadOnlyStyle-HorizontalAlign="Right" />
            <telerik:RadNumericTextBox runat="server" ID="RadNumericTextBox4" ReadOnly="true"
                Value="80000.85" ReadOnlyStyle-CssClass="disabledNumericTextboxBroken" NumberFormat-DecimalDigits="2"
                Width="110" ReadOnlyStyle-HorizontalAlign="Right" />
     
        </div>
        <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
            ReloadOnShow="true" runat="server" EnableShadow="true" />
        </form>
    </body>
    </html>
  2. Dan
    Dan avatar
    124 posts
    Member since:
    Feb 2011

    Posted 13 Apr 2012 Link to this post

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 18 Apr 2012 Link to this post

    Hi Dan,

    Modify your CSS selector for the readonly color as follows and the problem should go away (remove the !important):
    .riSingle.RadInput .disabledNumericTextboxBroken
    {
        color: Red;
    }


    Kind regards,
    Tsvetina
    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.
Back to Top