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

[Solved] ComboBox and TAB key

1 Answer 222 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Fernandes
Top achievements
Rank 1
Fernandes asked on 15 Jan 2008, 08:01 PM

Hi!

I've created a form, and made the necessary code to change the background color of every control (including Telerik's Combobox) whenever it has the Focus.

Everything was working perfectly. I mean, whenever I pressed the TAB key and the next control was a combobox, the combo immediatly gained the Focus.

While showing my great achievement to a colleague, the behaviour was a little different: We needed to press the TAB key twice so that the combo gained the focus.

The only difference is that I'm using IE 7.0.5730.11 and my colleague's browser is 7.0.5730.13...


My code snippets:

// My C# Code  
 
 public class BaseCombo : Telerik.Web.UI.RadComboBox  
    {  
        protected override void OnPreRender(EventArgs e)  
        {  
            this.Skin = "Outlook";  
            this.NoWrap = true;  
            this.OnClientFocus = "bcSetFocus";  
            this.OnClientBlur = "bcLostFocus";  
            base.OnPreRender(e);              
        }  
    } 

And...

<!--My javascript code-->  
 
function bcSetFocus(sender, eventArgs)  
{      
    var input= sender._inputDomElement;  
    input.style.background="fffaf0";   
}  
 
 
function bcLostFocus(sender, eventArgs)  
{  
      
    var input= sender._inputDomElement;  
    input.style.background="ffffff";   

Am I doing this the correct way? Thanks!

1 Answer, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 16 Jan 2008, 04:51 PM
Hi ,

Please find attached the latest build. Download it and give it a go. Let us known how this goes.

Greetings,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Fernandes
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Share this question
or