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!