We have a RadGrid with a RadNumericTextBox in a GridTemplateColumn. How can we have the grid highlight the row where the keyboard focus is? So as the user Tabs to the next RadNumericTextBox in the next row, the highlighted row of the grid should change.
1 Answer, 1 is accepted
0
Attila Antal
Telerik team
answered on 07 Aug 2019, 04:47 PM
Hi Mike,
By default the TAB key is not included in the KeyBoard nagivation functionality of the grid, and so, this needs to be implemented additionally.
You can try to wire up the onFocus client-side event to the numeric box and in the event handler, using some JavaScript/jQuery, mark the current row as active using the set_activeRow() method.
RadNumericTextBox in the ItemTemplate of a Template column:
<script type="text/javascript">
functionNumericTextBoxOnFocus(sender, args) {
// get reference to the current RadGridvar grid = sender.get_element().closest('.RadGrid').control;
// get reference to the current row (TR) elementvar currentRowElement = sender.get_element().closest('tr');
// set the row as active
grid.set_activeRow(currentRowElement);
}
</script>
Kind regards,
Attila Antal Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.