Save records by hitting a enter key
Posted on 2006-05-15
the "Enter" key.
I have textboxes( item template) inside of a gridview and a form view
The use can enter a number inside of the textbox and click save all button to be able to save the records that they just entered.
I was using below code to be able to achive the goal.
Here is the code
if(key == 13) document.getElementById('Button2').focus();
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
the functionally of this coce is when the user press the enter key in the textbox then set the focus to the save button... it's like the user do click on the button.
but I am getting an error says: ArgumentOutofRangeException was unhandled by user code. Specified argument ws out of the range of valid values" I made sure that Textbox2 is Cells...
wha I am doing wrong here??