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

[Solved] Radcombobox inside Radgrid how to defocus or blur the Combobox on Enter Key.

2 Answers 145 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pabanas
Top achievements
Rank 1
Pabanas asked on 02 Jun 2009, 01:16 AM
I  have Radcombobox inside Radgrid . I want it change focus to the next cell when enter key is pressed . I tried following the client events to blur the combobox but it does not work .


function blurComboBox(comboBox)
{
    if (comboBox.get_dropDownVisible() && comboBox.get_closeDropDownOnBlur())
        comboBox.hideDropDown()  ;
        comboBox.get_tableElement().className = "";
        comboBox._selectItemOnBlur() ;
        comboBox._focused = false ;
}

function HandkeKeyPress(sender, eventArgs) {
 
  
    if (eventArgs.get_domEvent().keyCode == 13) {

         blurComboBox(sender ) ;
            
            
            }
        }

 Please kindly help me .




2 Answers, 1 is accepted

Sort by
0
Pabanas
Top achievements
Rank 1
answered on 02 Jun 2009, 01:20 AM
I also tried the below client script to blur the combobox inside a Radgrid .

function  OnClientSelectedIndexChanged(sender, args) 
  var dom = sender.get_inputDomElement(); 
  dom.blur(); 


Still it does not work .
0
Tsvetoslav
Telerik team
answered on 04 Jun 2009, 11:07 AM
Hello Pabanas ,

In order to achieve this scenario, attach an event handler to the ClientEvents-OnKeyPressing event of the RadComboBox and in the event handler focus the control in the next cell. The concrete implementation of the latter depends on your RadGrid edit form settings.

Please, take a look at the attached sample for a demonstration of this functionality through jQuery. The jQuery library goes with the Telerik.Web.UI assembly and you can use its features by including it as a script reference in the ScriptManager control of the page.

I hope this helps.

Best Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Pabanas
Top achievements
Rank 1
Answers by
Pabanas
Top achievements
Rank 1
Tsvetoslav
Telerik team
Share this question
or