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

Readonly=true fields are FocusedStyle-BackColor is not set

3 Answers 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mohamed
Top achievements
Rank 1
mohamed asked on 24 Oct 2011, 12:05 PM

Readonly = true fields are FocusedStyle-BackColor not set


<telerik:RadNumericTextBox ID="Amount" runat="server" Width="85px" ReadOnly="true"
FocusedStyle-BackColor="Lavender" MaxLength="8">
</telerik:RadNumericTextBox>


Thanks,
Mohamed.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Oct 2011, 12:22 PM
Hello Mohammed,

I also faced the same issue. Since you are setting ReadOnly as true for the RadNumericTextBox, you should set ReadOnlyStyle-BackColor which worked as expected.
aspx:
<telerik:RadNumericTextBox ID="Amount" ReadOnlyStyle-BackColor="Lavender" runat="server" Width="85px" ReadOnly="true"
 MaxLength="8">
</telerik:RadNumericTextBox>


Thanks,
Princy.
0
mohamed
Top achievements
Rank 1
answered on 24 Oct 2011, 12:28 PM


Thanks alot Princy,
Readonly Color is come when the cursor is focused
How Set Color in telerik:RadComboBox

<telerik:RadComboBox ID="RadComboBox_Unit" runat="server" AutoPostBack="true" AppendDataBoundItems="true"
FocusedStyle-BackColor="Lavender" Width="70px" DataValueField="unitcode" DataTextField="unitdesc">
</telerik:RadComboBox>


Thanks,
Mohamed.
0
Princy
Top achievements
Rank 2
answered on 25 Oct 2011, 05:39 AM
Hello Mohamed,

I suppose your requirement is to set the backcolor of RadcomboBox on focus. So you can try the following javascript on OnClientFocus event.

JS:
<script type="text/javascript"
function OnClientFocus()
{
   var comboBox = $find("<%=RadComboBox1.ClientID %>");
   var input = comboBox.get_inputDomElement();
   input.focus();
   input.style.background = "Yellow";
}
</script>

Thanks,
Princy.
Tags
Grid
Asked by
mohamed
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
mohamed
Top achievements
Rank 1
Share this question
or