Site icon port135.com

How to set focus into Telerik RadListBox control?

If user clicks a RadListBox control, control won’t be automatically in focus even though you can make selections in the control (I know, it’s unexpected). It may get tricky to set focus into control. Try the lines below.

function focusOnList() {
    var dropdownSource = $find("countryList"); 
    // var dropdownSource = $find("<%= countryList.ClientID %>");
    dropdownSource._getGroupElement().focus();
    console.log(dropdownSource);
}

Don’t forget to call this function when selected index is changed in your list:

<telerik:RadListBox ... OnClientSelectedIndexChanged="focusOnList">
...
</telerik:RadListBox>

References

Exit mobile version