While working within a gridview on Internet Explorer, users can click on cells in one column to reveal a hidden textbox. After entering text into the textbox, users are instructed to press the Tab key to save changes. To accomplish this, a Javascript function is used to check for the Tab key and initiate the saving process by calling a stored procedure in the codebehind.
However, there seems to be an issue with the keydown event not always being triggered consistently. Despite working most of the time, there is no clear pattern as to when it fails to work. The inconsistency is frustrating, especially considering that it functions correctly 90% of the time.
It's important to note that when users click on a cell to edit the textbox, the gridview row updating event is fired first. This event needs to be enabled not only for editing the text in this particular column but also for updating data in other columns.
After successfully pressing the Tab key to save changes, the following events occur:
- Gridview row updating
- Keydown/SaveButton click
- Gridview row updating
The reason behind the second gridview row updating event after saving the text remains unclear. Although it does not disrupt any processes since the text has already been saved, the lack of consistency is worrisome. When the Tab key fails to save the text, only the first row updating event is triggered, resulting in lost changes reverting back to the original text.
As someone new to asp.net, I am hopeful that someone can provide insight into resolving this issue.