I have a textbox in a templatefield in webdatagrid. I am trying to use the up and down arrows to navigate as in excel. How do I set focus to textbox in template row on clientside?
Gary
Hello garyrg9,
Thank you for contacting our community.
I'm currently looking into this matter and will keep you posted of any available information.
At the meantime if you have any questions, please let me know.
Regards,
Tsanna
Gary,
I am not entirely sure about your scenario but you can certainly use the focus method like this:
document.all('WebDataGrid1_it2_2_TextBox1').focus();
Of course from what you wrote I assume that you have solved the other queries in this scenario but I will write what I can think of -
you can use the onkeydown event of the textbox, create a function in which you see what key is pressed (down arrow is 40), which you could check from window.event.keyCode.
The id of the controls are going up by 1 at the digit before the last underscore so they would go like this:
'WebDataGrid1_it2_0_TextBox1
'WebDataGrid1_it2_1_TextBox1
'WebDataGrid1_it2_2_TextBox1
Please let me know if all of this helps.