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

riLabel of RadNumericTextBox not showing enabled color when enabled through javascript.

3 Answers 74 Views
Input
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 2
Sean asked on 27 Apr 2011, 12:31 AM
Hi all,

I have a RadWindow which has controls that are enabled/displayed before display based on properties.
if (properties["AutoRefreshEnabled"] == "True") {
    document.getElementById('<%= CheckBox1.ClientID %>').checked = true;
    $find("<%= RadNumericTextBox1.ClientID %>").set_value(properties["AutoRefreshInterval"]);
    $find("<%= RadNumericTextBox1.ClientID %>").enable();
}

RadNumericTextBox1 is enabled and has its value set, the check box is set as well, but the label of RadNumericTextBox1 remains gray even though though its text box is enabled.

I've tried setting various CSS properties to remedy this.

.riLabel color: Black !important; causes the label to permanently stay Black regardless of whether I enable or disable it. Gray similarly.

I tried messing with .riLabel .LabelEnabled / .LabelDisabled, but was not seeing any effect. 

What's the proper way to get this to work?

Thanks,

Sean Anderson

3 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 29 Apr 2011, 09:36 AM
Hello Sean,

I have tried to reproduce the issue locally, but without success. Would you mind providing us with the following:

  • Sample runnable page that demonstrates the problem.
  • Does the issue replicates in all the supported browsers?
  • The exact version of RadControls that you are currently using.

Having these details would definitely help me draw a clear picture of your scenario and provide you with more to the point resolution.

Kind regards,
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.

0
Sean
Top achievements
Rank 2
answered on 02 Jun 2011, 12:51 AM
Hi,

Sorry for the long delay, just been busy elsewhere. A really simple demo of it is this:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Demo.aspx.cs" Inherits="RadControlsWebApp1.Demo" %>
 
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" Label="Text"
    Value="1" Enabled="False">
</telerik:RadNumericTextBox>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        function Demo(sender, eventArgs) {
            window.open("Demo.aspx", "WindowPopup", "width=400px, height=400px, resizable");
        }
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
 
    </div>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">   
        <Windows>
            <telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="Demo.aspx" >
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <telerik:RadButton ID="RadButton1" runat="server" onclientclicked="Demo"
        Text="Open Window">
    </telerik:RadButton>
    </form>
</body>
</html>

Observe that the riLabel of NumericTextBox is still black when the value field is grayed out. If I set NumericTextBox to disabled (and set the label class to riLabel LabelDisabled (where .LabelDisabled{ color: Gray !important;} ) I am able to force the label to gray instead of black. However, I am unsure of how to set this CSS client-side in javascript.

Yes this occurs on multiple browsers, I checked on IE8 and Chrome. I suspect it's a 'feature' not a bug, but in my eyes the text next to a disabled control should represent the 'enabledness' of the control. 
0
Accepted
Martin
Telerik team
answered on 03 Jun 2011, 04:38 PM
Hello Sean,

Based on the code you have provided I have created a small sample that demonstrates how to achieve the desired functionality. Please give it a try and let me know whether further assistance is needed.

Kind regards,
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.

Tags
Input
Asked by
Sean
Top achievements
Rank 2
Answers by
Martin
Telerik team
Sean
Top achievements
Rank 2
Share this question
or