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

[Solved] FocusedStyle for Combobox?

1 Answer 93 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Stephen Wright
Top achievements
Rank 2
Stephen Wright asked on 17 Jun 2009, 06:13 PM
Is there a property, similar to the RadTextbox property of FocusedStyle?

I'm looking to have the same behavior as my textboxes when they have the focus: FocusedStyle-BorderColor="#deb360"

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 Jun 2009, 07:29 AM
Hello Stephen,

t seems there is no direct property you can set to display a style when the RadComboBox is focused. But, you can achieve the same using the OnClientFocus and OnClientBlur client events of the combobox as shown below:
aspx:
<telerik:RadComboBox ID="RadComboBox1"   DataSourceID="SqlDataSource1"  
OnClientBlur="ClientBlur" OnClientFocus="ClientFocus" DataTextField="CompanyName" 
 DataValueField="CompanyName"  runat="server">         
</telerik:RadComboBox> 

js:
    function ClientFocus(sender, args) 
    {     
      sender.get_inputDomElement().className="myclass"
    } 
     
    function ClientBlur(sender, args) 
    { 
      sender.get_inputDomElement().className=""
    } 

css:
 .myclass  
    {  
     background-color:#deb360 !important;  
    }  

Thanks
Princy.
Tags
ComboBox
Asked by
Stephen Wright
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or