[英]How to navigate (up or down) in ASP.NET gridview using arrow keys?
[英]How to Move up and down in ASP.NET Gridview Using Arrow Keys
我在网格视图控件ItemTemplate中有一个网格视图控件,现在我想要的是文本框,按向下箭头键,第一行的第一个文本框中的光标将转到第二行的第一个文本框中
这是我想做的网格视图
使用此URL,它与代码一起使用。 使用箭头键浏览文本输入字段并返回
<script type="text/javascript">
$(document).ready(function(){
// get only input tags with class data-entry
textboxes = $("input.data-entry");
// now we check to see which browser is being used
if ($.browser.mozilla) {
$(textboxes).keypress (checkForAction);
}
else {
$(textboxes).keydown (checkForAction);
}
});
function checkForAction (event) {
if (event.keyCode == 13 || 40) {
currentBoxNumber = textboxes.index(this);
if (textboxes[currentBoxNumber + 1] != null) {
nextBox = textboxes[currentBoxNumber + 1]
nextBox.focus();
nextBox.select();
event.preventDefault();
return false;
}
}
}
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.